tags:

views:

57

answers:

1

Hello,

I am programatically creating instance of usercontrol as shown below

   Dim uc As Control
                uc = Me.LoadControl("~/Controls/DigitalSign.ascx")
                Me.Controls.Add(uc)

I have two public properties in my usercontorl like clerkName and RespName. How can I set those values in the above code. Intellisense is not showing ClerkName and respName Properties.

+3  A: 

something like this should work

            Dim uc As DigitalSign
            uc = CType(Me.LoadControl("~/Controls/DigitalSign.ascx"), DigitalSign)
            Me.Controls.Add(uc)
Fredou
Meaning... if you want Intellisense you need to use the type of YOUR usercontrol, not Control. +1
Dave Swersky