usercontrol datatype

Discussion in 'ASP .Net' started by =?Utf-8?B?QXJuZQ==?=, Aug 17, 2007.

  1. My code
    Dim AgentControl As UserControl
    AgentControl = LoadControl("AgentVerification.ascx")
    How do I change my usercontrol to type AgentVerification so I can invoke
    properties and methods in my usercontrol?

    --
    Arne Garvander
    Certified Geek
    Professional Data Dude
     
    =?Utf-8?B?QXJuZQ==?=, Aug 17, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?QXJuZQ==?=

    Riki Guest

    Arne wrote:
    > My code
    > Dim AgentControl As UserControl
    > AgentControl = LoadControl("AgentVerification.ascx")
    > How do I change my usercontrol to type AgentVerification so I can
    > invoke properties and methods in my usercontrol?


    Make sure that the ClassName property is set in the Control directive (first
    line of AgentVerification.ascx).

    Then you can use a cast:
    Dim AgentControl As myClassName
    AgentControl = CType(LoadControl("AgentVerification.ascx"),myClassName)

    --

    Riki
     
    Riki, Aug 18, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi
    Replies:
    1
    Views:
    730
    David Waz...
    Jul 3, 2003
  2. Rajesh Tiwari

    Can we use a usercontrol inside a usercontrol

    Rajesh Tiwari, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    437
    Rajesh Tiwari
    Aug 12, 2003
  3. nail
    Replies:
    0
    Views:
    1,568
  4. Phl
    Replies:
    2
    Views:
    546
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Nov 18, 2004
  5. Jeff
    Replies:
    2
    Views:
    1,184
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 16, 2007
Loading...

Share This Page