Results 1 to 3 of 3

Thread: ASCX and Tag Params

Threaded View

  1. #1

    Thread Starter
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    ASCX and Tag Params

    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:
    1. Dim WC1 As TempControl = LoadControl("template.ascx")
    2. WC1.EnableViewState = True
    3. 'WC1.myVar = "hi"
    4. 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:

    Code:
    <rat:template myVar="hi" id="temp1" runat="server" />
    How do I do the commented line?
    Last edited by Lord_Rat; Dec 16th, 2002 at 01:03 PM.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width