Page load of the parent page called twice when a modal dialog is opened from a button click of the u

Discussion in 'ASP .Net' started by Samy, Aug 11, 2005.

  1. Samy

    Samy Guest

    Hi There,
    I have a user control with buttons on it which I use on a aspx page
    (parent page). On a button click, a modal dialog(aspx page) opens up
    and the user enters some info in the modal dialog and clicks the save
    button on it. The info is saved to the DB and the parent page is
    refreshed. Everything works fine but for some reason the page load is
    called twice. I have set the AutoEventWireUp = false on every page.
    Also I have load event defined on the parent page and the child page
    (which opens as a modal dialog). User control doesn't have any load
    event defined. Can somebody help me please?
    Thanks a lot.
     
    Samy, Aug 11, 2005
    #1
    1. Advertising

  2. If you're using a server control as the button to popup the modal
    dialog, change it to just a plain html <button > tag.

    If you need/want to keep the server control, put "return false;" at
    the end of the javascript to prevent that button click from causing a
    postback.

    --
    Jason Kendall



    On 11 Aug 2005 06:34:11 -0700, "Samy" <>
    wrote:

    >Hi There,
    >I have a user control with buttons on it which I use on a aspx page
    >(parent page). On a button click, a modal dialog(aspx page) opens up
    >and the user enters some info in the modal dialog and clicks the save
    >button on it. The info is saved to the DB and the parent page is
    >refreshed. Everything works fine but for some reason the page load is
    >called twice. I have set the AutoEventWireUp = false on every page.
    >Also I have load event defined on the parent page and the child page
    >(which opens as a modal dialog). User control doesn't have any load
    >event defined. Can somebody help me please?
    >Thanks a lot.
     
    Jason Kendall, Aug 12, 2005
    #2
    1. Advertising

  3. Samy

    Samy Guest

    This is the code in the button click event handler...

    StringBuilder strScript = new StringBuilder();
    strScript.Append("<script language=JavaScript>");
    strScript.Append("window.open('EditSavedProfile.aspx','EditProfile','width=650px,height=450px,left=250px,top=80px','return
    false');");
    strScript.Append("</script> ");
    Page.RegisterClientScriptBlock("subscribescript",strScript.ToString()
    );

    But for some reason, the parent page loads twice....after the save
    button of the modal dialog is clicked..Is there a syntax error or smth
    else? I am unable to figure it out...
    Can somebody help me?
    Thanks.
     
    Samy, Aug 15, 2005
    #3
    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. mike parr
    Replies:
    1
    Views:
    512
    Marina
    May 20, 2004
  2. Lisa
    Replies:
    1
    Views:
    522
    Matt Berther
    Jan 18, 2005
  3. Bali
    Replies:
    0
    Views:
    450
  4. Bali
    Replies:
    1
    Views:
    3,512
    bruce barker
    Nov 1, 2008
  5. Bali
    Replies:
    9
    Views:
    294
    Dr J R Stockton
    Nov 4, 2008
Loading...

Share This Page