Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

How to show an aspx page like a dialog

$
0
0
hi,
I've designed this user control(*.ascx) in asp .net,
 
<scripttype="text/javascript">function but_ok() {
            window.returnValue = "ok";
            window.close();
        }
        function but_cancel() {
            window.returnValue = "cancel";
            window.close();
        }
        function but_yes() {
            window.returnValue = "yes";
            window.close();
        }
        function but_no() {
            window.returnValue = "no";
            window.close();
        }
    </script><asp:ButtonID="dlg_ok"runat="server"Text=" OK "/><asp:ButtonID="dlg_cancel"runat="server"Text=" Cancel "/><asp:ButtonID="dlg_yes"runat="server"Text=" Yes "/><asp:ButtonID="dlg_no"runat="server"Text=" No "/>
 
and i've written these codes to assume each button behavior
 
protectedvoid Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            dlg_ok.Attributes["onclick"] = "javascript:but_ok()";
            dlg_cancel.Attributes["onclick"] = "javascript:but_cancel()";
            dlg_yes.Attributes["onclick"] = "javascript:but_yes()";
            dlg_no.Attributes["onclick"] = "javascript:but_no()";
        }
    }
 
now I want to show this page like a dialog and use it as a message box,
 
so I have 2 questions
1-how do I display this control or an aspx page like a dialog?
2-how do I retrieve values after clicking each button?
 
I will appreciate if any one could help Smile | :)

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>