I have created some custom forms (ascx files) and am trying to programmatically load some at run-time.
I can load them with the following code:
VB Code:
Dim WC1 As TempControl = LoadControl("template.ascx") WC1.EnableViewState = True 'WC1.myVar = "hi" pnlWorkspace.Controls.Add(WC1)
Notice the commented line.
In the ascx file, there is a variable, myVar. I would like to set a value for it. If the tag were created at design time, it would look like this:
How do I do the commented line?Code:<rat:template myVar="hi" id="temp1" runat="server" />




Reply With Quote