Create a WebForm1.aspx page, add a TextBox and a Button control, and write the statement for registering the client script in Page_Load:
Private void Page_Load (object sender, System. EventArgs e)
{
// Place user code here to initialize the page
If (! Page. IsClientScriptBlockRegistered ("clientScript "))
{
StringBuilder sbScript = new StringBuilder ();
SbScript. Append ("<script> ");
SbScript. Append ("function OpenWin (){");
SbScript. Append ("var str={{showmodaldialog('webform2.aspx', document.form1.txt WndName. value )");
SbScript. Append ("if (str! = Null) document.Form1.txt WndName. value = str ");
SbScript. Append ("} </script> ");
String script = sbScript. ToString ();
RegisterClientScriptBlock ("clientScript", script );
}
This. btnOpen. Attributes. Add ("OnClick", "OpenWin ()");
}
Create a WebForm2.aspx page and put it in two frameworks:
<Frameset rows = "0, *">
<Frame src = "about: blank"
<Frame src = "WebForm3.aspx">
</Frameset>
Create a WebForm3.aspx page and write the script registration statement in Page_Load:
Private void Page_Load (object sender, System. EventArgs e)