Skip to content

What is showmodaldialog and the function of it?

Kumar Shanmugam

Asked Aug 4, 2012, 1:50 AM EDT7 answers
Share
LinkedInX
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
----------------





   






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

   
   



   
   
   

   


   
 
            Width="77px" />
   


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

7 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Akkiraju Ivaturi
    0
    You might have to set target = _self. <!doctype html public "-//w3c//dtd html 4.0 transitional//en" >
    0
  • 0
    yeah i already wrote this code target=_self but its not work.... so help me for this problem i hope you all the c-sharp members...
    0
  • 0
    No one have solution for this problem...............?

    any one consider my problem and give the solution.....



    this is my last request.........



    Kumar
    0
  • Akkiraju Ivaturi
    0
    Hey Kumar,

    I asked you to use the syntax targer = _self.

    OK. I have taken your code and added the target and it works in IE. What is your browser version?

    You have to add <base target="_self"/> after <head id = "Head1" runat="server">

    as below:

    <head if="head1" runat="server">
    <base target="_self"/>
    <title></title>
    ...

    This you have to include in your child.aspx. Let me know if you are still facing the challenge. But do send me the browser version too.

    If this satisfies your problem, mark the answer as accepted
    0
  • Akkiraju Ivaturi
    0
    Also remove your response.write in the button click event..I think that is creating a problem... I think removing that will solve the issue.
    0
  • 0
    I am executing script from server side ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "javascript:var ans = window.showModalDialog('TransactionHistoryDetail.aspx?' + '&rowID=" + rowID + "&Type=" + OrderType + "&OrderNo=" + OrderNo + "', 'dialogWidth=1000px;dialogHeight=700px;resizable: yes;dialogLeft=' + ((screen.width - 1000) / 2) + ';dialogTop=' + (screen.height - 700) / 2 + ''); ", true); I am not able to change the dialogWidth and Height If I am changed the both value in the script Plz help me to solve the issue
    0
  • 0
    I am executing script from server side ScriptManager.RegisterStartupScript(this, typeof(Page), UniqueID, "javascript:var ans = window.showModalDialog('TransactionHistoryDetail.aspx?' + '&rowID=" + rowID + "&Type=" + OrderType + "&OrderNo=" + OrderNo + "', 'dialogWidth=1000px;dialogHeight=700px;resizable: yes;dialogLeft=' + ((screen.width - 1000) / 2) + ';dialogTop=' + (screen.height - 700) / 2 + ''); ", true); I am not able to change the dialogWidth and Height If I am changed the both value in the script Plz help me to solve the issue
    0