Multiple page load happens on one ASPX page

Discussion in 'ASP .Net' started by quoclinh, Mar 9, 2007.

  1. quoclinh

    quoclinh Guest

    I have an aspx page with code behind that has the initial page load
    code happens many times as user perform different action on the page,
    such as select a drop down list. To be more clear, consider the
    following code:

    protected override void Page_Load(object sender, EventArgs e)
    {

    if (!IsPostBack)
    {
    //Code in here gets trigger 3 times every time the user perform
    action on asp.net control
    // that would triggers post back
    }
    }

    The aspx page code is too complicated to post here. I am curious if
    anyone has any possible explanations for different scenario that this
    could happens? Thanks for your input.

    Quoc Linh
     
    quoclinh, Mar 9, 2007
    #1
    1. Advertising

  2. - There may be some Response.Redirect in code recursively redirecting
    to itself.
    - There may be some javascript tied to client-side onload event of
    body or some image recursively posting back again and again.
    - In VS 2003, AutoEventWireup="true" used to get conflict if during
    design you unknowingly had double-clicked a control. However in that
    scenario it used to be max two calls.
    - Although you explicitly mentioned its an aspx, an ascx may have
    Page_Load called multiple times if there are multiple instances on
    same page.
     
    Muhammad Naveed Yaseen, Mar 10, 2007
    #2
    1. Advertising

  3. - There may be some Response.Redirect in code recursively redirecting
    to itself (either directly in same file, or via some other code
    suscribing to your code's structured events or bubble events).

    - There may be some javascript tied to client-side onload event of
    body or some image recursively posting back again and again.

    - In VS 2003, AutoEventWireup="true" used to get conflict if during
    design you unknowingly had double-clicked a control. However in that
    scenario it used to be max two calls, not three.

    - Although you explicitly mentioned its an aspx, an ascx may have
    Page_Load called multiple times if there are multiple instances on
    same page.
     
    Muhammad Naveed Yaseen, Mar 10, 2007
    #3
  4. quoclinh

    quoclinh Guest

    On Mar 10, 12:14 am, "Muhammad Naveed Yaseen" <>
    wrote:
    > - There may be some Response.Redirect in code recursively redirecting
    > to itself (either directly in same file, or via some other code
    > suscribing to your code's structured events or bubble events).
    >
    > - There may be some javascript tied to client-side onload event of
    > body or some image recursively posting back again and again.
    >
    > - In VS 2003, AutoEventWireup="true" used to get conflict if during
    > design you unknowingly had double-clicked a control. However in that
    > scenario it used to be max two calls, not three.
    >
    > - Although you explicitly mentioned its an aspx, an ascx may have
    > Page_Load called multiple times if there are multiple instances on
    > same page.


    Thank you for the reply. I will re-exam my code with these
    possibilities.
     
    quoclinh, Mar 12, 2007
    #4
    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. Iain

    Multiple aspx for one aspx.cs

    Iain, Jun 24, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    430
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: Multiple aspx for one aspx.cs

    Phil Winstanley [Microsoft MVP ASP.NET], Jun 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    335
  3. mortb
    Replies:
    3
    Views:
    5,486
    bruce barker
    Nov 30, 2004
  4. Lady
    Replies:
    3
    Views:
    825
    Patrice
    Nov 25, 2005
  5. NM
    Replies:
    6
    Views:
    505
    Default User
    Sep 20, 2006
Loading...

Share This Page