Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2010, 05:53 PM
Authorized User
 
Join Date: Mar 2009
Posts: 74
Thanks: 5
Thanked 0 Times in 0 Posts
Default Please hepl, how can I access the masterpage usercontrol

I have a usercontrol which is loaded into a placeholder when a menu item is clicked, how can I update another usercontrol which is on the masterpage when an item on the dynamically loaded usercontrol is clicked thanks.
 
Old May 13th, 2010, 03:25 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you know the ID of the other control you could use the FindControl method to get a reference to the other control.

Alternatively you could add an event to your user control which you page can then handle and pass information to the other control.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old May 13th, 2010, 11:29 PM
Authorized User
 
Join Date: Mar 2009
Posts: 74
Thanks: 5
Thanked 0 Times in 0 Posts
Default Thanks

Thanks, thats what I been trying to do, the problems is that
am a new asp developer, this masterpage access is what I hope to master
very soon, right now I need some really practically instructions if possible,
thanks.

Last edited by ysfkay; May 13th, 2010 at 11:35 PM..
 
Old May 14th, 2010, 04:30 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The following will get you the control on the page if you know the ID. You can then call methods on it etc:

Code:
UserControl1 control = (UserControl1)Page.FindControl("UserControlID");
control.DoSomething();
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old May 16th, 2010, 07:34 PM
Authorized User
 
Join Date: Mar 2009
Posts: 74
Thanks: 5
Thanked 0 Times in 0 Posts
Default Thanks

Thanks alote for the tip!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access control from usercontrol peter2004 ASP.NET 1.x and 2.0 Application Design 10 January 28th, 2010 11:00 PM
Access MasterPage control in contentpage bhadrinath.medi ASP.NET 2.0 Professional 1 November 10th, 2009 05:23 PM
Masterpage teddyk ASP.NET 2.0 Basics 1 September 15th, 2008 08:37 AM
How to access Menu in MasterPage from Content mohan.raju ASP.NET 2.0 Professional 0 October 12th, 2006 03:29 AM
My first MasterPage grstad ASP.NET 2.0 Basics 4 June 7th, 2006 11:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.