Page_Load called more than once for user control - newbie question

K

keith

Hi,

I have a page with a user control as header, which in turn has a user
control drop down list.

When I run the page in debug with a break on the page load events for the
page, on the header control, and the drop down list.

I hit the breaks in this order
1) Page
2) Header
3) Header
4) Drop down

For both hits on the Header, IsPostBack is false.

I would have guessed that having the sub-user control drop down was causing
the second firing of the Page_Load in the header, but as it's Page_Load
occurs afterwards, I just don't know.

I looked at my page to see if there were 2 references to the Header, but in
the Html there is only the register statement and the one that places it on
the page.

There is also a dim protected with events for it in the code behind.

It's not a big problem, but when I tried to add a second user control to the
Header, it would crash after the second Page_Load, with the dissassembly
showing nop and a blank second column, which I assume means a null pointer.

Any enlightenment, or even pointing to an appropriate web page would be
welcome.
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top