pass value from modal popup in ascx page to textbox in aspx page

Last post 05-09-2008 6:53 AM by softsan. 1 replies.

Sort Posts:

  • pass value from modal popup in ascx page to textbox in aspx page

    05-09-2008, 6:13 AM
    • Loading...
    • ahmedmcsd
    • Joined on 05-09-2008, 12:58 AM
    • Posts 1

    Hi everybody,

    i've a user control (ascx file) contains one button, when i click this button a modal popup should appear. This popup contains a gridview so i could select one record so the id of this record will store in a hidden control after that i click the ok button. i used this user control on a aspx page which have an empty textbox. What i want is when i select a record and click ok on the popup the textbox on the aspx page take the value of the hidden control in the ascx page.

    i tried to make that but the ok button on the popup didn't make a postback so the value of the textbox didn't appear before i make a manualy refresh for the page and this's not a solution. and i tried to add a postback attribute for the ok button but when i did that the page totaly refreshed and i lost all the data in the aspx and the ascx. So how can i solve this problem ??

     sorry for my english , i hope that i explained my problem clearly.

    thanks alot for ur interest...

  • Re: pass value from modal popup in ascx page to textbox in aspx page

    05-09-2008, 6:53 AM
    Answer
    • Loading...
    • softsan
    • Joined on 11-28-2007, 4:48 AM
    • Gujarat, India
    • Posts 12

    you can store that value in session and then after coming back to your original page you can retrieve that value from the session.

    you can also use following statement on OKButton click event:

     Response.Write("<script language='javascript' type='text/javascript'>window.opener.document.forms[0].submit();self.close();</script>"); 

    Try this out, hope it will help you to overcome your problem. 

    Sudhir Thanki
    Software Engineer
    Microsoft Certified Technical Specialist.
Page 1 of 1 (2 items)