7
Answers

what is showmodaldialog and the function of it?

Kumar Shanmugam

Kumar Shanmugam

11y
2.6k
1
Hi,

I have problem by using "showmodaldialog" in my application. I am using ASP.NET with C#

here i submit some code

parent.aspx page
----------------
<head>
<script type="text/javascript">
            function test() {        
            window.showModalDialog("child.aspx","","dialogHeight=5;dialogWidth=10;center=1;status=0;resizable=1;help=0");        
        }
</script>
</head>

<body>
    <form id="form1" runat="server">
<input type="button" value="Click" onclick="test()" />

</form>
</body>


child.aspx
----------
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function test1() {
            self.close();
        }

</script>
</head>

<body>
    <form id="form1" runat="server">
    <input type="button" value="OK" onclick="test1()" />
    <br />
    <br />

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
&nbsp;
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Click"
        Width="77px" />
    </form>
</body>

child.aspx.cs
-------------

       protected void Button1_Click(object sender, EventArgs e)
        {
          Response.Write(TextBox1.Text);
        }

after open the child.aspx page, if i click "OK" mean, Its work properly

but if i did any other event without close the child page in popup window it will open new and normal webpage.


but the code will work in only firefox in another browser is not work(IE,Chrome,Opera)

So how can i solve it..... Help me


Answers (7)