A
Andrew
I have been reading some of the User Control postings and just want to ask a
simple question to verify whether or not this would be the preferred or
recommended way to implement.
I have an aspx page that has some text boxes, a drop down list and a
placeholder control into which I dynamically load user controls. The User
Control that is loaded into the placeholder is determined by the value in
the drop down box. Thus I potentially need to change the User Control
loaded in the postback event of the aspx page. There are six User Controls
in all.
Woudl the recommended implementation be to load all the controls in the
Page_Init method and load them to the PlaceHolder control in that method.
Then in my Page Load event and the Drop down list postback I would just
hide/show the User Control that I needed? I think that seems to be the
consensus from some of the posts that I have been reading. If that is the
case then I have a couple questions.
-- How is ViewState handled for the controls that are contained on the User
Controls (Drop down List, Data Grid Text Boxes, etc.) Do I need to do
anything manually?
-- When is the Page_Load event for the User Control going to be fired?
Would that happen after the Page Load event for the page?
Not sure if this is enough information for some feedback, but would
appreciate any feedback that anyone would have that has done something
similar that could help me out.
Thanks.
simple question to verify whether or not this would be the preferred or
recommended way to implement.
I have an aspx page that has some text boxes, a drop down list and a
placeholder control into which I dynamically load user controls. The User
Control that is loaded into the placeholder is determined by the value in
the drop down box. Thus I potentially need to change the User Control
loaded in the postback event of the aspx page. There are six User Controls
in all.
Woudl the recommended implementation be to load all the controls in the
Page_Init method and load them to the PlaceHolder control in that method.
Then in my Page Load event and the Drop down list postback I would just
hide/show the User Control that I needed? I think that seems to be the
consensus from some of the posts that I have been reading. If that is the
case then I have a couple questions.
-- How is ViewState handled for the controls that are contained on the User
Controls (Drop down List, Data Grid Text Boxes, etc.) Do I need to do
anything manually?
-- When is the Page_Load event for the User Control going to be fired?
Would that happen after the Page Load event for the page?
Not sure if this is enough information for some feedback, but would
appreciate any feedback that anyone would have that has done something
similar that could help me out.
Thanks.