TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hector_busto
NA
18
0
Dynamic user controls
Nov 10 2004 11:42 AM
Hello. I have a web C# project with a form with 3 buttons and 3 placeholders, each placeholder contains a Web User Control, when I click over button 1 it shows the data of WUC1, when I click over button 2 it shows the data of WUC2 and when I click over button 3 it shows the data of WUC3. My solution was to make initially invisible the 3 placeholders and when a button is clicked then I made visible the corresponding placeholder, as the following code from button 1 shows: this.PlaceHolder1.Visible = true; this.PlaceHolder2.Visible = false; this.PlaceHolder3.Visible = false; This works well, but I think it's not too eficient to have loaded the 3 WUCs, so I'm trying to make a dynamic load of each WUC depending the button clicked, example of button 1: private void btn1_Click(object sender, System.EventArgs e){ this.PlaceHolder1.Controls.Clear(); this.PlaceHolder2.Controls.Clear(); this.PlaceHolder3.Controls.Clear(); this.PlaceHolder1.Controls.Add(LoadControl("WUC1.ascx")); //Only load the WUC1 } This code load well the WUCs, show the data, but it can't execute the events of the WUCs, because in each WUC I have buttons that perform some operations and this events don't execute, i put a breakpoint and show that the page_load of the page that contains the WUCs, I think it's a problem of dynamic load of controls, any idea would be appreciated. Thanks a lot.
Reply
Answers (
2
)
listing data into listbox
Socket connect with proxy server