Page Is Loading Twice...

A

Art Cabot

My page is firing the Page_Load twice on both initial load and on a button
click. On the initial load, both times it fires "IsPostback" shows false. On
the button clicks, "IsPostback" shows true, which I'd expect, but what could
be making Page_Load fire twice?

The page is populating a list box, if that's a clue, but the code to do this
is within the If Not IsPostback...End If block.
 
S

Scott M.

What makes you believe that Page_Load is fired 2 times for a given page
request?
 
A

Art Cabot

Because I set a breakpoint inside the "If Not IsPostback...End if" block
that's inside the Page_Load event and it stops there twice when the page is
first loaded (with PostBack=False) and also whenever a button click event
occurs (with PostBack=True).

Art

Scott M. said:
What makes you believe that Page_Load is fired 2 times for a given page
request?
 
A

Art Cabot

Found the problem in the HTML of the page. For whatever reason,
AutoEventWireup was set to "True" instead of "False". Once reset, the issue
went away.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top