如何将父页面控件值传递给asp.net中的模态对话框窗口? [英] How to pass parent page control values to modal dialog window in asp .net?

查看:90
本文介绍了如何将父页面控件值传递给asp.net中的模态对话框窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是将页面控件值发送到ASP .Net中的模态对话窗口的最佳方法。现在我正在使用包含整个页面控件(超过25个TextBox)细节的会话。在模态对话框窗口页面中,我正在操作Session以获取值,这似乎是一些繁琐的过程。有没有其他最好的方法来实现这一目标。



我正在使用java脚本下面打开模态对话框窗口。



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.

<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>

推荐答案

参考 - showModalDialog:发送和返回值 [ ^ ]。您只需要通过 showModalDialog 函数将值作为参数传递。



通过 window.dialogArguments 。
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.


您可以使用HttpCookiesCollection类。

You can use the HttpCookiesCollection class.
HttpCookieCollection hh = new HttpCookieCollection();
 HttpCookie ht = new HttpCookie("cookiesName");

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

 }


这篇关于如何将父页面控件值传递给asp.net中的模态对话框窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆