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 / July 2007

Tip: Looking for answers? Try searching our database.

Casting a Variable to User control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dinu - 31 Jul 2007 12:58 GMT
How to Cast a Variable to User control in ASP.NET using vb.net as code-
behind
Peter Bucher [MVP] - 31 Jul 2007 13:25 GMT
Hello Dinu

> How to Cast a Variable to User control in ASP.NET using vb.net as code-
> behind

Dim myUserControl As UserControl = DirectCast(<var>, UserControl)

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Dinu - 31 Jul 2007 13:50 GMT
On Jul 31, 5:25 pm, "Peter Bucher [MVP]" <peter.buc...@aspnetzone.de>
wrote:
> Hello Dinu
>
[quoted text clipped - 6 lines]
> Gruss, Peter Bucher
> Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerlandhttp://www.aspnetzone.de/- ASP.NET Zone, die ASP.NET Communityhttp://www.aspnetzone.de/blogs/peterbucher/- Auf den Spuren von .NET

Hi
thanks for ur response,

can we use Ctype method??
Peter Bucher [MVP] - 31 Jul 2007 15:35 GMT
Hi Dinu

> can we use Ctype method??
Yes you can, read:
- http://www.google.ch/search?hl=de&q=ctype+vs+directcast&meta=

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Dinu - 31 Jul 2007 13:54 GMT
Hi Peter,

Can u tell me how can we dynamically access properties of a user
control
in master page from a content page and set properties of user control
in master page from content page

thanks
Peter Bucher [MVP] - 31 Jul 2007 15:43 GMT
Hi Dinu

> Can u tell me how can we dynamically access properties of a user
> control
> in master page from a content page and set properties of user control
> in master page from content page
Access the masterpage in a contentpage with this.Master.Page, use further
the .FindControl() methode
of the masterpage to find the usercontrol. (Or use .FindControl twice, for
the ContainerControl in the masterpage AND then for the specific usercontrol
within the container.
then cast the usercontrol (Control) to (UserControl) and access the
properties you want.

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET


Rate this thread:







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.