autopostback causing several Page_Loads to fire

I have a dot.net aspx page and two user control included on the page, lets say user control A and user control b.  I have a dropdown that triggers an autopostback on user control a.  Curently when autopostback fires, it is making all three Page_Load's fire.  I really need autopostback to only make the Page_Load for the user control it is a child of.  Is this possible?  Dont know if this matters, but I am using Update Panels in each user control.  
rawcoderAsked:
Who is Participating?
 
ddayx10Commented:
I'm sorry but this is normal behavior and cannot be stopped.

When a page is posted back from any source it will fire its own event cycle (including page_load) as well as the event life cycles of any relevant child controls (ascx pages).

What has to be done is to understand this and strategically plan how to handle situations. I'm sure thats cold comfort for you about now but it is an important "step up" in your process to undertand the page life cycle events and how to utilize them best without them getting in your way.

This may be something as simple as using if(!isPostBack) in the  page_loads where you don't want things to occur each time. It may be that you need to re-think how you can do some things you are now doing in page_loads.

As a small aside if you are using update panels on your user controls only then only the controls inside an individual update panel content template should be affected by any postback made by its triggers. Now this statement may not be able to be taken as absolute as the permeutations surrounding what you may be doing are enormous, but in general that is true.

Its really hard to say more, but that is the answer. Hope it helps.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.