I want to display in a panel at run time different controls, depending on the menu selection.
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1) Add all user controls inside a parent page with Visible = false. Depending menu selection, make Visible = true.
Advantages – Easy to implement
Disadvantages – Expensive. Every user control’s Load event will be called on parent page is loaded.
2) Load a control dynamically to a place holder.
this.PlaceHolder1.Controls.Add(child);
Advantages – Light weight.
Disadvantages – Need to write some code if parent page wants to retrieve data from user control after post back.