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
littlesun69
NA
5
0
writing a function that calls a web user control in .cs file
Mar 15 2004 3:27 AM
I'm trying to write a function in a .cs file that when called by the index.aspx page it loads the corresponding user control. public static void loadUserControl() { Control controlHeader = null; Control controlNavigationMain = null; Control controlNavigationSub = null; Control controlCategory = null; String strControlDir= "user_controls/"; controlHeader = LoadControl(strControlDir + "header_home.ascx"); controlNavigationMain = LoadControl(strControlDir + "navigation_home_main.ascx"); controlNavigationSub = LoadControl(strControlDir + "navigation_home_sub.ascx"); controlCategory = LoadControl(strControlDir + "home_history.ascx"); // loads controls headerPlaceholder.Controls.Add(controlHeader); navigationMainPlaceholder.Controls.Add(controlNavigationMain); navigationSubPlaceholder.Controls.Add(controlNavigationSub); categoryPlaceholder.Controls.Add(controlCategory); } I'm not proficient at all with asp.net, so please ellaborate. If you could give me an example of what to do, I would REALLY appreciate it!
Reply
Answers (
1
)
Selecting Values in a DataGrid, via a checking a CheckBox
Does anyone know how to use web user controls and placeholders?