asp.net - Passing value from popup window to parent form's TextBox -


work on asp.net visual studio 2008 c#. have page. page need call page on popup. on popup page selected value set on parent page text control.

  1. one parent page
  2. one child page.
  3. call parent child popup.
  4. on popup window contain grid.
  5. on popup grid have command select,click on select close popup , selected value set on parent page text control.

i have done steps 1,2,3 , 4. need complete step no 5.

on parent page:

<script type="text/javascript">     function f1() {         window.open("child.aspx");     } </script> <asp:textbox id="textbox1" runat="server"></asp:textbox><input type="button" onclick="f1();" value="pop up" /> 

on child page:

<script type="text/javascript"> function f2() {      opener.document.getelementbyid("textbox1").value = "hello world"; } </script> <input type="button" value="return hello world" onclick="f2();" /> 

also can pass id of control want fill child page parameter:

window.open("child.aspx?controlid=<%=textbox1.clientid %>"); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -