The actual user control itself checks for an id in a querystring. If it is greater than 0, the user control fires a method to grab data from a database, at the data layer, return the datatable, and sets the textbox value to a cell value in the datatable.
This is all done in the user control...
ok, well when I create a new instance of the control in the code behind, and load that in the placeholder, then try and set a textbox in the control codebehind to a value returned by a database query, it tells me the textbox control is null. How do I initialize the control hierarchy after...
This still leaves me with the problem of having to register every control on the actual aspx page.
What I'm trying to do, is have a gateway page with a placeholder. in the codebehind I check a querystring, and add the control based on that querystring. The controls are in a different project...
I'm trying to add a control to my webpage in the codebehind using something like this:
placeHolder.Controls.Add(new asp.mycontrol_ascx);
but the asp namespace isn't showing up, what do I need to do or reference to get it to show up?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.