Last post Apr 20, 2005 01:49 PM by sowens
Apr 20, 2005 12:54 PM|sowens|LINK
I am sure this can be done, but I am bashing my virtual head against the Google search bar as we speak...
I want to register user controls on the page dynamically based on the value selected in a datagrid (right now I call in the
TravelRequest.ascx statically) . This allows me to add any number of items to access without registering the controls each time I add a new item...it is all driven with generic tables and stored dures....
Here is what I am thinking:
lblDynamicUserControl and lblDynamicControl are labels that I placed on the top of the main control and the other in a panel on the page. They do write out to the page between span tags,
but well it doesn't work. I am pretty sure this will work as soon as I find the right way to register the control correctly in the code behind. I am pretty sure using a label is wrong in what I am attempting but as to the correct way, google eludes me today.
Anyone have a thought?
Apr 20, 2005 01:41 PM|bmains|LINK
Page.LoadControl() loads user controls in the code-behind.
Apr 20, 2005 01:49 PM|sowens|LINK
Doh.....that indeed looks like it will work. Google is your friend if you add the right content to search on [:(]
Thanks for the help...