aspx pages load twice

Discussion in 'ASP .Net' started by Sylvain Lafontaine, Feb 12, 2005.

  1. Most of the time, this is caused by the property AutoEventWireup set to true
    instead of false.

    S. L.

    "surveyor04" <> wrote in message
    news:...
    >
    > Can someone help me try to figure out why my pages load twice? While
    > debugging other issues, I notice that a great many of my pages run
    > through the onload method twice, and sometimes they run through the
    > onclick method of buttons two times as well. As far as onlick is
    > concerned, I checked the .NET designer code and there is only 1 event
    > handler wired up, so I don't know why these actions are occuring in
    > duplicate. Is there a way to trace through and find out why?
    >
    >
    >
    > --
    > surveyor04
    > ------------------------------------------------------------------------
    > Posted via http://www.codecomments.com
    > ------------------------------------------------------------------------
    >
    Sylvain Lafontaine, Feb 12, 2005
    #1
    1. Advertising

  2. Sylvain Lafontaine

    surveyor04 Guest

    Can someone help me try to figure out why my pages load twice? While
    debugging other issues, I notice that a great many of my pages run
    through the onload method twice, and sometimes they run through the
    onclick method of buttons two times as well. As far as onlick is
    concerned, I checked the .NET designer code and there is only 1 event
    handler wired up, so I don't know why these actions are occuring in
    duplicate. Is there a way to trace through and find out why?



    --
    surveyor04
    ------------------------------------------------------------------------
    Posted via http://www.codecomments.com
    ------------------------------------------------------------------------
    surveyor04, Feb 12, 2005
    #2
    1. Advertising

  3. Are you running with ASP.NET 1.1 sp1?

    Microsoft .NET Framework 1.1 Page_Load Event Fires Two Times

    http://support.microsoft.com/kb/827801

    http://support.microsoft.com/kb/885055


    "surveyor04" <> wrote in message
    news:...
    >
    > Can someone help me try to figure out why my pages load twice? While
    > debugging other issues, I notice that a great many of my pages run
    > through the onload method twice, and sometimes they run through the
    > onclick method of buttons two times as well. As far as onlick is
    > concerned, I checked the .NET designer code and there is only 1 event
    > handler wired up, so I don't know why these actions are occuring in
    > duplicate. Is there a way to trace through and find out why?
    >
    >
    >
    > --
    > surveyor04
    > ------------------------------------------------------------------------
    > Posted via http://www.codecomments.com
    > ------------------------------------------------------------------------
    >
    Ken Cox [Microsoft MVP], Feb 12, 2005
    #3
  4. Sylvain Lafontaine

    Brian Guest

    I've had large chunks of code execute twice, due to bad programming on my
    part.

    Sometimes I needed to add a if(!Page.IsPostBack){ ... } wrapper to certain
    function calls to make sure they only executed on the intial page load..
    other times, I had certain objects or user controls with ViewState enabled
    (which is default) but not always necessary and occasionally triggered
    unanticpated code execution.


    "surveyor04" <> wrote in message
    news:...
    >
    > Can someone help me try to figure out why my pages load twice? While
    > debugging other issues, I notice that a great many of my pages run
    > through the onload method twice, and sometimes they run through the
    > onclick method of buttons two times as well. As far as onlick is
    > concerned, I checked the .NET designer code and there is only 1 event
    > handler wired up, so I don't know why these actions are occuring in
    > duplicate. Is there a way to trace through and find out why?
    >
    >
    >
    > --
    > surveyor04
    > ------------------------------------------------------------------------
    > Posted via http://www.codecomments.com
    > ------------------------------------------------------------------------
    >
    Brian, Feb 14, 2005
    #4
  5. Try setting AutoEventWireup set to false..
    Cos i think by default its true.I had the smae problem once but this
    fixed it..
    Patrick



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 14, 2005
    #5
    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. Krzysztof Rozmus

    All pages in ASP.NET application load twice

    Krzysztof Rozmus, Jul 23, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    354
    Krzysztof Rozmus
    Jul 25, 2003
  2. surveyor04

    aspx pages load twice

    surveyor04, Feb 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    318
    surveyor04
    Feb 14, 2005
  3. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    Long Delay in initial load of ASPX pages

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Aug 18, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    2,339
    r2thej151
    Aug 19, 2006
  4. Kiuhnm

    twice(twice(x))

    Kiuhnm, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    386
    Kiuhnm
    Apr 1, 2006
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,190
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page