Multiple page load happens on one ASPX page

Q

quoclinh

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
 
M

Muhammad Naveed Yaseen

- 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.
 
M

Muhammad Naveed Yaseen

- 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.
 
Q

quoclinh

- 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top