Page_Load fires twice with Mozilla

Discussion in 'ASP .Net' started by =?Utf-8?B?RWQ=?=, Nov 20, 2004.

  1. Has anyone seen this one? I have a situation where code in my page_load event
    is firing twice for mozilla firefox users. Everything is fine in IE6. I set
    breakpoints and verified.
    The second time the page_load fires in mozilla, I checked the IsPostback to
    verify that it is still false.
    What causes this behavior?
    Thanks,
    Ed
     
    =?Utf-8?B?RWQ=?=, Nov 20, 2004
    #1
    1. Advertising

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

    Kumar Reddi Guest

    Hi Ed,
    check to see if you have AutoEventWireup set to true in the Page
    directive

    Kumar

    "Ed" <> wrote in message
    news:...
    > Has anyone seen this one? I have a situation where code in my page_load

    event
    > is firing twice for mozilla firefox users. Everything is fine in IE6. I

    set
    > breakpoints and verified.
    > The second time the page_load fires in mozilla, I checked the IsPostback

    to
    > verify that it is still false.
    > What causes this behavior?
    > Thanks,
    > Ed
    >
     
    Kumar Reddi, Nov 20, 2004
    #2
    1. Advertising

  3. Hi,
    I currently have it set to false.

    Thanks,
    Ed

    "Kumar Reddi" wrote:

    > Hi Ed,
    > check to see if you have AutoEventWireup set to true in the Page
    > directive
    >
    > Kumar
    >
    > "Ed" <> wrote in message
    > news:...
    > > Has anyone seen this one? I have a situation where code in my page_load

    > event
    > > is firing twice for mozilla firefox users. Everything is fine in IE6. I

    > set
    > > breakpoints and verified.
    > > The second time the page_load fires in mozilla, I checked the IsPostback

    > to
    > > verify that it is still false.
    > > What causes this behavior?
    > > Thanks,
    > > Ed
    > >

    >
    >
    >
     
    =?Utf-8?B?RWQ=?=, Nov 20, 2004
    #3
  4. =?Utf-8?B?RWQ=?=

    Greg Johnson Guest

    > Hi,
    > I currently have it set to false.
    >
    > Thanks,
    > Ed


    I'm seeing the same thing. I have AutoEventWireup also set to false,
    yet I see Page_Init and Page_Load getting called twice in Firefox. In
    IE, it only gets called once. A bug in Firefox?
     
    Greg Johnson, Dec 1, 2004
    #4
  5. Actually, I found the answer to my own problem. It occured for me in the
    html. We had an external javascript file included in the control we used for
    the page header. Under certain situations, it would be written out as double
    quotes without the file name. That caused the page to load twice. I assure
    you that was not an easy find.

    I have heard other instances of similiar problems with malformed html or css.

    Hope that helps.

    "Greg Johnson" wrote:

    > > Hi,
    > > I currently have it set to false.
    > >
    > > Thanks,
    > > Ed

    >
    > I'm seeing the same thing. I have AutoEventWireup also set to false,
    > yet I see Page_Init and Page_Load getting called twice in Firefox. In
    > IE, it only gets called once. A bug in Firefox?
    >
     
    =?Utf-8?B?RWQ=?=, Dec 7, 2004
    #5
  6. =?Utf-8?B?RWQ=?=

    drogovoy

    Joined:
    Jun 3, 2009
    Messages:
    1
    Other reasons

    I've read that everything matters to firefox. For example closing css lines with ";" even though it displayed correctly. Also colors start with #.
    In my case my asp.net pages contained asp:image controls where imageurl property was not present at all. After I added it only postback happens. -Tool a while to get this right also. Both Safari and Crome worked fine even without it.
     
    drogovoy, Jun 3, 2009
    #6
  7. =?Utf-8?B?RWQ=?=

    nkindia

    Joined:
    Sep 2, 2009
    Messages:
    2
    Firefox will reload the page automatically, if

    1) There is atleast one blank link to a style sheet like

    <Link href="" rel="stylesheet">

    2) Blank script reference

    <script src="" language="javascript/>

    3) Broken important html tags, like <img> without </img> or empty source attributes for image, or background color

    4) missing ";" after a css class statement like

    .href
    {
    color:black
    }

    (there should be semicolon after black, and a "." before the class name href)

    ... and so on.

    Be careful when you code html, in Firefox. A small mistake can cause it to behave wierdly. FF will distort styles, if you dont specify the parmaeters properly, or there is insufficient space to draw. Also, it will load the page twice, silently if there are any errors (like mentioned above)... and this can cause your application to behave wierdly.
     
    nkindia, Sep 2, 2009
    #7
  8. =?Utf-8?B?RWQ=?=

    shailpatel83

    Joined:
    Jun 11, 2009
    Messages:
    9
    I am aware of following two things.

    If you have img control with empty string assigned to src attribute.
    <img src=””/>
    <asp:image runat=”server” id=”img”/>
    You may be forgot to assign imageurl or wanted to assign imageurl in code behind based on the some condition and that condition never gets executed and ended up being empty string assigned to src attribute when ASP.Net renders the page.

    If you have empty string assigned to href attribute to html link for stylsheet.
    <link rel=”stylesheet” href=””/>

    If you have empty src attribute set to script.
    <script src=”” type=”text/javascript”>

    for more information you can read my post.
    patelshailesh.com/index.php/page_load-event-fires-twice-with-firefox-only
     
    shailpatel83, Apr 2, 2010
    #8
    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. H Branyan

    Page_Load fires twice

    H Branyan, Oct 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    698
    H Branyan
    Oct 22, 2003
  2. Jon
    Replies:
    1
    Views:
    11,508
    George Ter-Saakov
    Jan 13, 2004
  3. Jay Douglas
    Replies:
    7
    Views:
    628
  4. doobdave
    Replies:
    3
    Views:
    4,137
    Jeff Evans
    Dec 17, 2004
  5. =?Utf-8?B?RXJpayBKZW5zZW4=?=

    CodeBehind But Not Postback - Page_Load fires twice

    =?Utf-8?B?RXJpayBKZW5zZW4=?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,381
    =?Utf-8?B?RXJpayBKZW5zZW4=?=
    Jul 21, 2005
Loading...

Share This Page