<strong>First is the code of the parent page: </strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="20312" class="copybut" id="copybut20312" onclick="doCopy('code20312')"><u>Copy the code </u></a></span> The code is as follows: </div> <div class="codebody" id="code20312"> <br><head runat="server"> <br><title>Untitled page</title> <br><%-- <script type="text/javascript"> <br>function openDia() { <br>var returned = window.showModalDialog("Default4.aspx?" (new Date()), window); <br>if (returned) { <br>document.getElementById("ret"). innerHTML = returned; <br>} <br>else { <br>document.getElementById("ret").innerHTML = ""; <br>} <br>} <br></script> --%> ; <br><script type="text/javascript"> <br>function openDia(){ <br>var returned = window.showModalDialog("Default3.aspx?" (new Date()), window); <br>if (returned){ <br>document.getElementById("tbtext").value = returned; <br>} <br>else{ <br>document.getElementById("tbtext").value = ""; <br>} <br>} <br></script> <br></head> <br><body> <br><form id="form1" runat="server"> <br><div id="ret"> <br><input id="tbtext" type="text" value="" onclick="openDia();return false;" /> <br>< ;/div> <br><asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="openDia();return false;" /> <br><input id=" Hidden1" type="hidden" runat="server" /> <br></form> <br></body> <br></html> <br> </div> <br>About adding The one above (new Data()) is to avoid the problem of automatic caching of the showModalDialog page, which will cause the data to not be refreshed when the page is opened for the second time. This is because if the URL of the showModalDialog page is the same every time, it will automatically display the previously cached page. the data inside. <br>Then there is the code of the sub-page Default3.aspx: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="12026" class="copybut" id="copybut12026" onclick="doCopy('code12026')"><u>Copy the code</u></a></span> The code is as follows: </div> <div class="codebody" id="code12026"> <br><head runat="server"> <br><title>Untitled page</title> <br><script type="text/javascript"> <br>function getSelected(data) { <br>var str = data; <br>window.returnValue = str.toString(); <br>window.close(); <br>} <br></script> <br><base target= "_self"/> <br></head> <br><body> <br><form id="form1" runat="server" target=""> <br><div> <br><asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"> <br><Columns> <br><asp:TemplateField> <br><ItemTemplate> <br><asp:LinkButton id="lnkSelect2" runat="server" Text="Select" > </asp:LinkButton> <br></ItemTemplate> <br></asp:TemplateField> <br></Columns> <br></asp:GridView> <br> </div> <br></form> <br></body> <br></html> <br> </div> <br>Default3.aspx contains a gridview control. After data binding (bind it yourself, the code will not be posted), you can select the data you need. <br>Default3.aspx.cs: <br>[code] <br>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) <br>{ <br>if (e.Row.RowType == DataControlRowType.DataRow) <br>{ <br>LinkButton b = (LinkButton)e.Row.FindControl("lnkSelect2"); <br>b.Attributes.Add("OnClick", "javascript:getSelected('" e.Row.Cells[1] .Text "');"); <br>} <br>} <br>[html] <br>The <base target="_self between <head></head> in Default3.aspx "/> and <form target=""> are used to prevent the third form from popping up after clicking the select button on the subpage. <br>This is the example. You still have to experience and improve it according to your own needs.