![]() |
Casting a Variable to User control
How to Cast a Variable to User control in ASP.NET using vb.net as code-
behind |
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 |
Re: Casting a Variable to User control
On Jul 31, 5:25 pm, "Peter Bucher [MVP]" <peter.buc...@aspnetzone.de>
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?? |
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 |
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=...rectcast&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 |
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 |
| All times are GMT. The time now is 01:04 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.