Forms in Modal IE Window create a new window on postback!

Discussion in 'ASP .Net' started by =?Utf-8?B?TmljayBQb3VsaXM=?=, Jun 2, 2005.

  1. In my page I use window.ShowModalDialog

    ----------------------------------------------------------------
    Page.RegisterStartupScript("PopUpPerson", _
    "<script language=""Javascript"">" & vbCrLf & _
    "window.showModalDialog('Person.aspx?id=" & SelectedPersonID &
    "','','dialogWidth:720px; dialogHeight:450px; status:eek:ff; center:Yes;
    help:No; scroll:No;');" & vbCrLf & _
    "</script>")
    -----------------------------------------------------------------

    to render a details page in a modal window. Yet when I press a button to
    Save the
    modifications on that page the page postbacks and redraws in a new window.

    The Save button is a server side ASP:Button which for the moment does nothing.

    How can I prevent a postback event to open a new window to redraw the page?


    -------------------------------
    Nick Poulis
    Radix Information Systems
    Greece
    -------------------------------
     
    =?Utf-8?B?TmljayBQb3VsaXM=?=, Jun 2, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TmljayBQb3VsaXM=?=

    Jinsong Liu Guest

    Add <base target=_self> to the head block of the Person.aspx

    On Thu, 2 Jun 2005 10:37:16 -0700, "Nick Poulis"
    <> wrote:

    >Page.RegisterStartupScript("PopUpPerson", _
    >"<script language=""Javascript"">" & vbCrLf & _
    >"window.showModalDialog('Person.aspx?id=" & SelectedPersonID &
    >"','','dialogWidth:720px; dialogHeight:450px; status:eek:ff; center:Yes;
    >help:No; scroll:No;');" & vbCrLf & _
    > "</script>")
     
    Jinsong Liu, Jun 2, 2005
    #2
    1. Advertising

  3. Thanks for your answer I will try it next thing in the morning :)
    -------------------------------
    Nick Poulis
    Radix Information Systems
    Greece
    -------------------------------


    "Jinsong Liu" wrote:

    > Add <base target=_self> to the head block of the Person.aspx
    >
    > On Thu, 2 Jun 2005 10:37:16 -0700, "Nick Poulis"
    > <> wrote:
    >
    > >Page.RegisterStartupScript("PopUpPerson", _
    > >"<script language=""Javascript"">" & vbCrLf & _
    > >"window.showModalDialog('Person.aspx?id=" & SelectedPersonID &
    > >"','','dialogWidth:720px; dialogHeight:450px; status:eek:ff; center:Yes;
    > >help:No; scroll:No;');" & vbCrLf & _
    > > "</script>")

    >
    >
     
    =?Utf-8?B?TmljayBQb3VsaXM=?=, Jun 2, 2005
    #3
  4. =?Utf-8?B?TmljayBQb3VsaXM=?=

    Jeffrey Todd Guest

    I hope his suggestion works for you...hasn't for me. I have done extensive
    research on this and have received about 6 different solutions. -- the
    *only* way I have found to solve the problem you describe is to have the
    modal dialog be a frameset (or an iFrame). The pages that show up in the
    frameset or iFrame can post back and will be redisplayed in the frame/iFrame
    and will not open in a new window.

    -HTH


    "Nick Poulis" <> wrote in message
    news:...
    > Thanks for your answer I will try it next thing in the morning :)
    > -------------------------------
    > Nick Poulis
    > Radix Information Systems
    > Greece
    > -------------------------------
    >
    >
    > "Jinsong Liu" wrote:
    >
    >> Add <base target=_self> to the head block of the Person.aspx
    >>
    >> On Thu, 2 Jun 2005 10:37:16 -0700, "Nick Poulis"
    >> <> wrote:
    >>
    >> >Page.RegisterStartupScript("PopUpPerson", _
    >> >"<script language=""Javascript"">" & vbCrLf & _
    >> >"window.showModalDialog('Person.aspx?id=" & SelectedPersonID &
    >> >"','','dialogWidth:720px; dialogHeight:450px; status:eek:ff; center:Yes;
    >> >help:No; scroll:No;');" & vbCrLf & _
    >> > "</script>")

    >>
    >>
     
    Jeffrey Todd, Jun 3, 2005
    #4
  5. =?Utf-8?B?TmljayBQb3VsaXM=?=

    Peter Yao Guest

    try disable smart navigation
     
    Peter Yao, Jun 3, 2005
    #5
  6. =?Utf-8?B?TmljayBQb3VsaXM=?=

    Jeffrey Todd Guest

    That's not a universal solution - can't reasonably ask all users to disable
    smart navigation.


    "Peter Yao" <> wrote in message
    news:%...
    > try disable smart navigation
    >
    >
     
    Jeffrey Todd, Jun 3, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Henry

    modal forms and postback

    Brian Henry, Jul 5, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    5,808
    Brian Henry
    Jul 5, 2004
  2. Leila
    Replies:
    0
    Views:
    413
    Leila
    Apr 26, 2005
  3. Matt
    Replies:
    1
    Views:
    3,152
    Whitecrest
    Jun 1, 2004
  4. Matt
    Replies:
    0
    Views:
    220
  5. gopal srinivasan
    Replies:
    0
    Views:
    237
    gopal srinivasan
    Nov 5, 2004
Loading...

Share This Page