1.default.aspx page
Copy Code code as follows:
<script type= "Text/javascript" >
function GetUser (Txtempid,txtempname,url)
{
var properties = ' status:no;resizable:no;toolbar=no;menubar=no;location=no;scroll:no;dialogwidth:540px; dialogheight:450px; '
var arg=window.showmodaldialog (URL, "", properties);
if (arg!=null)
{
document.getElementById (Txtempid). Value=arg[0];
document.getElementById (Txtempname). Value=arg[1];
}
}
</script>
<table width= "240px" cellpadding= "0" cellspacing= "0" >
<tr>
<TD style= "width:80px" >
<asp:label id= "Label1" runat= "Server" text= "Select Class One" Width= "80px" class= "Font-w" ></asp:Label></td>
<TD style= "width:80px" >
<asp:textbox id= "TextBox1" runat= "Server" readonly= "false" Width= "80px" onfocus= "This.blur ()" ></asp: Textbox>
</td>
<TD style= "width:80px" >
<asp:textbox id= "TextBox2" runat= "Server" readonly= "false" Width= "80px" ></asp:TextBox>
</td>
<TD style= "width:80px" >
<asp:button id= "Button1" runat= "text=" onclick= button1_click "cssclass=" buttoncss
</td>
<td>
<asp:label id= "Label3" runat= "Server" text= "" ></asp:Label></td>
<td> <asp:label id= "Label4" runat= "Server" text= "" ></asp:Label></td>
</tr>
</table>
2.default.aspx.cs
Copy Code code as follows:
protected void Page_Load (object sender, EventArgs e)
{
TEXTBOX1.ATTRIBUTES.ADD ("onclick", "GetUser" (' "+ this.) Textbox1.clientid + "', '" + this. Textbox2.clientid + "', ' webdialog.aspx)");
}
3.webdialog.aspx
Copy Code code as follows:
<script language= "javascript" type= "Text/javascript" >
function Submit ()
{
var arr=new Array ();
arr[0]= document.getElementById (' Txtempid '). Value
arr[1]= document.getElementById (' Txtempcname '). Value
arr[2]= document.getElementById (' Txttitleid '). Value
Window.returnvalue=arr;
Window.close ();
}
</script>
<table>
<tr><td>
<asp:textbox id= "Txtempid" runat= "Server" width= "50px" readonly= "true" cssclass= "Inputcss" ></asp:textbox >
<asp:textbox id= "Txtempcname" runat= "Server" width= "60px" readonly= "true" cssclass= "Inputcss" ></asp: Textbox>
<asp:textbox id= "Txttitleid" runat= "Server" width= "40px" readonly= "true" cssclass= "Inputcss" ></asp:textbox >
</tr></td>
<tr><td>
<input id= "Button1" type= "button" value= "Confirm" onclick= "Submit ()"/>
</tr></td>
</table>