Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page load of the parent page called twice when a modal dialog is opened from a button click of the user control on the parent page

Reply
Thread Tools

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

 
 
Samy
Guest
Posts: n/a
 
      08-11-2005
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.

 
Reply With Quote
 
 
 
 
Jason Kendall
Guest
Posts: n/a
 
      08-12-2005
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.

 
Reply With Quote
 
 
 
 
Samy
Guest
Posts: n/a
 
      08-15-2005
This is the code in the button click event handler...

StringBuilder strScript = new StringBuilder();
strScript.Append("<script language=JavaScript>");
strScript.Append("window.open('EditSavedProfile.as px','EditProfile','width=650px,height=450px,left=2 50px,top=80px','return
false');");
strScript.Append("</script> ");
Page.RegisterClientScriptBlock("subscribescript",s trScript.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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refreshing parent page from a child page opened as a modal dialog box Bali Javascript 9 11-04-2008 07:26 PM
Refreshing parent page from a child page opened as a modal dialog box Bali ASP .Net 1 11-01-2008 08:34 PM
Refreshing parent page from a child page opened as a modal dialog boxOptions Bali ASP .Net 0 10-31-2008 09:57 PM
Aspx page opened as a modal dialog Lisa ASP .Net 1 01-18-2005 07:06 PM
button click event being called twice on click mike parr ASP .Net 1 05-20-2004 04:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57