FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. [modified]
-
I'm really fighting this issue where Firefox is loading my pages twice. Running through the debugging of the pages, my OnInit and Page_Load events are executed twice. This only happens using FireFox, IE7 loads the pages properly. I've been researching the issue and found all the normal "Empty image src" posts and even tried the AutoEventWireup being set to false, and none have resolved my issue. It's causing me all sorts of problems, double emails, double database entries being written, etc. Please can someone just point me in some direction? I would be very grateful. I'm using VS Team Suite SP1, 3.5 SP1 of the framework and FireFox 3.07. Here is my simple most stripped down test page that the issue is still occurring on.
]]>
Untitled Page
And the CodeBehind:
using System;
namespace RSD.DADS.Web
{
public partial class WebForm2 : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
}protected void Page\_Load(object sender, EventArgs e) { if (!IsPostBack) { FillLabel1(); FillLabel3(); FillLabel4(); } } private void FillLabel1() { Label1.Text = "From FillLabel1()"; FillLabel2(); } private void FillLabel2() { Label2.Text = "From FillLabel2()"; } private void FillLabel3() { Label3.Text = "From FillLabel3()"; } private void FillLabel4() { Label4.Text = "From FillLabel4()"; }
}
}modified on Wednesday, March 18, 2009 2:52 PM
-
I'm really fighting this issue where Firefox is loading my pages twice. Running through the debugging of the pages, my OnInit and Page_Load events are executed twice. This only happens using FireFox, IE7 loads the pages properly. I've been researching the issue and found all the normal "Empty image src" posts and even tried the AutoEventWireup being set to false, and none have resolved my issue. It's causing me all sorts of problems, double emails, double database entries being written, etc. Please can someone just point me in some direction? I would be very grateful. I'm using VS Team Suite SP1, 3.5 SP1 of the framework and FireFox 3.07. Here is my simple most stripped down test page that the issue is still occurring on.
]]>
Untitled Page
And the CodeBehind:
using System;
namespace RSD.DADS.Web
{
public partial class WebForm2 : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
}protected void Page\_Load(object sender, EventArgs e) { if (!IsPostBack) { FillLabel1(); FillLabel3(); FillLabel4(); } } private void FillLabel1() { Label1.Text = "From FillLabel1()"; FillLabel2(); } private void FillLabel2() { Label2.Text = "From FillLabel2()"; } private void FillLabel3() { Label3.Text = "From FillLabel3()"; } private void FillLabel4() { Label4.Text = "From FillLabel4()"; }
}
}modified on Wednesday, March 18, 2009 2:52 PM
Well I was able to stop the page from loading twice in Firefox. All the outputted HTML validated just fine using FireBug, but then just on a whim, I decided to remove the DOCTYPE line. and page only ran through once. I didn't think that the "XHTML 1.0 Transitional" would have been strict enough to cause this. So I tried using then tried Neither stopped FireFox from loading the page twice. So far the only way that the page is not running through the Page_Load twice, is if I remove the DOCTYPE all together. Any thoughts as to why this would be happening?
-
I'm really fighting this issue where Firefox is loading my pages twice. Running through the debugging of the pages, my OnInit and Page_Load events are executed twice. This only happens using FireFox, IE7 loads the pages properly. I've been researching the issue and found all the normal "Empty image src" posts and even tried the AutoEventWireup being set to false, and none have resolved my issue. It's causing me all sorts of problems, double emails, double database entries being written, etc. Please can someone just point me in some direction? I would be very grateful. I'm using VS Team Suite SP1, 3.5 SP1 of the framework and FireFox 3.07. Here is my simple most stripped down test page that the issue is still occurring on.
]]>
Untitled Page
And the CodeBehind:
using System;
namespace RSD.DADS.Web
{
public partial class WebForm2 : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
}protected void Page\_Load(object sender, EventArgs e) { if (!IsPostBack) { FillLabel1(); FillLabel3(); FillLabel4(); } } private void FillLabel1() { Label1.Text = "From FillLabel1()"; FillLabel2(); } private void FillLabel2() { Label2.Text = "From FillLabel2()"; } private void FillLabel3() { Label3.Text = "From FillLabel3()"; } private void FillLabel4() { Label4.Text = "From FillLabel4()"; }
}
}modified on Wednesday, March 18, 2009 2:52 PM
-
I'm really fighting this issue where Firefox is loading my pages twice. Running through the debugging of the pages, my OnInit and Page_Load events are executed twice. This only happens using FireFox, IE7 loads the pages properly. I've been researching the issue and found all the normal "Empty image src" posts and even tried the AutoEventWireup being set to false, and none have resolved my issue. It's causing me all sorts of problems, double emails, double database entries being written, etc. Please can someone just point me in some direction? I would be very grateful. I'm using VS Team Suite SP1, 3.5 SP1 of the framework and FireFox 3.07. Here is my simple most stripped down test page that the issue is still occurring on.
]]>
Untitled Page
And the CodeBehind:
using System;
namespace RSD.DADS.Web
{
public partial class WebForm2 : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
}protected void Page\_Load(object sender, EventArgs e) { if (!IsPostBack) { FillLabel1(); FillLabel3(); FillLabel4(); } } private void FillLabel1() { Label1.Text = "From FillLabel1()"; FillLabel2(); } private void FillLabel2() { Label2.Text = "From FillLabel2()"; } private void FillLabel3() { Label3.Text = "From FillLabel3()"; } private void FillLabel4() { Label4.Text = "From FillLabel4()"; }
}
}modified on Wednesday, March 18, 2009 2:52 PM
Out of interest, why did you add the oninit event? That is your problem, cause it runs the oninit event which fires the page_load event, and then the page loads which then executes the Page_loads event again, because it is two different events and not a post back your IsPostBack check will return false causing your fill methods to run twice (Once on the oninit and once on the page_load).
No matter how long he who laughs last laughs, he who laughs first has a head start!
-
Out of interest, why did you add the oninit event? That is your problem, cause it runs the oninit event which fires the page_load event, and then the page loads which then executes the Page_loads event again, because it is two different events and not a post back your IsPostBack check will return false causing your fill methods to run twice (Once on the oninit and once on the page_load).
No matter how long he who laughs last laughs, he who laughs first has a head start!
The problem occurs with or without the onInit event. The issue happened prior to my adding of the onInit. I added that once I changed my AutoEventWireup property to false, which was a frequently found suggestion. Once it was changed to false, I then had to declare the page_load event or it (page_load) never executed. Did you happen to take the code and run through debugging it with FireFox 3.0.7? Does it not execute the page twice? The only way that I was able to make the page stop executing the whole page two times was to remove the DOCTYPE declaration. Thanks for your input.