How to pop up a web form as a modal dialog box??
Hi,
I've two webforms. When a condition is satisfied, I need to pop up a webform as a modal dialog box where the user can enter some text.After submitting this child form, the user had to be redirected to some other webform. Inorder to catch the text,I've used a session variable.
What I've worked is......
In html page, I've written
<script language="javascript">
function giveReason(w,h)
{
wleft = (screen.width-w) / 2;
wtop = (screen.height-h) / 2;
imgwindow1=window.open("HiReason.aspx","imgwindow1 ","width="+w+",height="+h+",left="+wleft+",top="+w top+"status:Yes;");
imgwindow1.focus();
}
</script>
And I've called the above script function in codebehind page as...
jstr = "<script language='JavaScript'> giveReason(500,170);</script>"
Page.RegisterClientScriptBlock("reasonKey", jstr)
After that...
In child form,
Dim strjscript As String = ""
strjscript = "<script language=javascript>"
strjscript &= "window.opener.Home.Text1.focus();"
strjscript &= "window.close();"
strjscript = strjscript & "</script" & ">"
RegisterClientScriptBlock("close", strjscript)
Home is some other webbform's id.
While running this,I'm getting the error.... "imgwindow1 is null or not an object. poop up window is blocked"
Any suggestions?? Thanks in advance....
-Priya
|