Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

cast in VB.Net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arne - 01 Aug 2007 22:56 GMT
Dim uc As UserControl
uc = LoadControl("\usercontrol\topheader.ascx")
Dim top As TopHeader
How do I convert uc to datatype TopHeader?
In C# I would do a cast. I have forgot how to do a cast in VB.Net
Signature

Certified Geek

Mark Rae [MVP] - 01 Aug 2007 23:22 GMT
> In C# I would do a cast. I have forgot how to do a cast in VB.Net

http://www.codeproject.com/dotnet/CheatSheetCastingNET.asp

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Manish Bafna - 02 Aug 2007 07:14 GMT
Hi,
try this code:
dim r as topheader= ctype(Page.LoadControl("\usercontrol\topheader.ascx"),
topheader)
Where topheader is the name of usercontrol class
Signature

Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

>  Dim uc As UserControl
>  uc = LoadControl("\usercontrol\topheader.ascx")
>  Dim top As TopHeader
> How do I convert uc to datatype TopHeader?
> In C# I would do a cast. I have forgot how to do a cast in VB.Net

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.