Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How to make a user control not fire its page load event when not visible?

$
0
0

I have a page that based on the parameters passed in, it loads one of two user controls. They have conflicting page_load events that make each of them non-functional if they are both loaded.

I at first tried to make them not visible and set the one I was using to visible, but this still fires the event of both of them.

I then tried putting a placeholder there and programatically loading the controls whenever the parameter was met, but when I click a button causing a postback on the control, it disappears.

Is there any solution to my problem?

 


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>