Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. [modified]

FireFox loading my pages twice. No Images exist, AutoEventWireup is false - Code included. [modified]

Scheduled Pinned Locked Moved ASP.NET
databasevisual-studiodesigncollaborationhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bill Lawton
    wrote on last edited by
    #1

    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

    B R J 3 Replies Last reply
    0
    • B Bill Lawton

      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

      B Offline
      B Offline
      Bill Lawton
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • B Bill Lawton

        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

        R Offline
        R Offline
        rajmca g
        wrote on last edited by
        #3

        just remove below code in oninit event and try..... this.Load += new System.EventHandler(this.Page_Load);

        1 Reply Last reply
        0
        • B Bill Lawton

          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

          J Offline
          J Offline
          JacquesDP
          wrote on last edited by
          #4

          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!

          B 1 Reply Last reply
          0
          • J JacquesDP

            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!

            B Offline
            B Offline
            Bill Lawton
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups