DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 31 Jul 2007 04:58:33 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Dinu
          2    Peter Bucher [MVP]
                 3    Peter Bucher [MVP]
                 4    Peter Bucher [MVP]
          5    Dinu
          6    Dinu


Casting a Variable to User control   
How to Cast a Variable to User control in ASP.NET using vb.net as code-
behind
Date:Tue, 31 Jul 2007 04:58:33 -0700   Author:  

Re: Casting a Variable to User control   
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)

-- 
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
Date:Tue, 31 Jul 2007 14:25:32 +0200   Author:  

Re: Casting a Variable to User control   
On Jul 31, 5:25 pm, "Peter Bucher [MVP]" 
wrote:

> 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)
>
> --
> 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??
Date:Tue, 31 Jul 2007 05:50:57 -0700   Author:  

Re: Casting a Variable to User control   
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
Date:Tue, 31 Jul 2007 05:54:55 -0700   Author:  

Re: Casting a Variable to User control   
Hi Dinu


> can we use Ctype method??

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

-- 
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
Date:Tue, 31 Jul 2007 16:35:39 +0200   Author:  

Re: Casting a Variable to User control   
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.

-- 
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
Date:Tue, 31 Jul 2007 16:43:21 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us