Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > usercontrol datatype

Reply
Thread Tools

usercontrol datatype

 
 
=?Utf-8?B?QXJuZQ==?=
Guest
Posts: n/a
 
      08-17-2007
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
 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      08-18-2007
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"),myClas sName)

--

Riki


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
database datatype bit what is the C# datatype? Jeff ASP .Net 2 04-16-2007 08:26 PM
accessing usercontrol from another usercontrol Phl ASP .Net 2 11-18-2004 07:33 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari ASP .Net 0 08-12-2003 03:56 PM
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack huobazi ASP .Net 1 07-03-2003 03:14 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57