Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Which is best way to send page controls value to Modal Dialog Window in ASP .Net. Right now i'm using session which holds entire page controls (more than 25 TextBox) details. In Modal Dialog Window page i'm manipulating Session to get the value and it seems some what tedious process. Is there any other best way to achieve this.

I'm using below java script to open modal dialog window.

JavaScript
<script type="text/javascript">
        function OpenDialog() {
            if (Page_ClientValidate()) {
                window.showModalDialog('Modal.aspx', 'Confirmation', 'center:yes; resizable:no; status:yes; dialogWidth:500px; dialogHeight:600px');
            }
        }
    </script>
Posted
Updated 7-Dec-13 21:12pm
v3
Comments
What type of Modal window you are using? Can you show the code?
mn.sathish 8-Dec-13 3:02am    
Hi, I've updated my modal dialog window script.
Please check my answer.

Refer- showModalDialog: send and return values[^]. You just need to pass the values as parameter through showModalDialog function.

Read them by window.dialogArguments in the modal page.
 
Share this answer
 
Comments
mn.sathish 10-Dec-13 5:27am    
Thank you very much.....,
Most Welcome Sathish. :)
You can use the HttpCookiesCollection class.
C#
HttpCookieCollection hh = new HttpCookieCollection();
 HttpCookie ht = new HttpCookie("cookiesName");

 protected void Button1_Click(object sender, EventArgs e)
 {
     ht.Value = TextBox1.Text;
     hh.Add(ht);

 }
 
Share this answer
 
Comments
Why two answers? Please improve one and delete the other.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900