By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,288 Members | 3,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,288 IT Pros & Developers. It's quick & easy.

Need to dynamically load user controls

P: 6
I need to dynamically load controls and access the methods and property of the control from the page. I need to load a different control depending on a selection made by the user. I have buttons on the page whose click events call methods on the controls that process the data selected by the user. I thought I could register one control on the page then call usercontrol.LoadControl(path) to redirect the registered control to a different ascx file. However, instead, the initially registered control persists in loading. I then tried to instantiate the control in code and load that, but then the page will not compile because the methods being called by the buttons on the page do not yet exist. Does anyone have any ideas?
Aug 6 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.