Register
|
Articles
|
Questions
|
Projects
|
Asp.Net Tips
|
Free Magazines
|
Tutorials
|
Search
|
Write to us
|
Login
Search
Articles
Asp.Net 2.0
AJAX
ADO.Net
C#
Javascript
Books
Asp.Net 2.0
AJAX
ADO.NET
C#
JavaScript
MS SQL Server
VB.NET
XML
Web Service
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
How to Find Master Page controls from the Child or Content Pages?
Posted by
Moderator1
on
7/1/2009 7:11:53 AM
1771
Views
To find the controls in the Master Pages, you can use the FindControl method of the Master class.
The sample code is given below
HyperLink HyperLink1 = (HyperLink)Master.FindControl("HyperLink1");
if (HyperLink1 != null)
{
HyperLink1.NavigateUrl = "http://www.google.com/";
HyperLink1.Text = "Changing Text From Child Page";
}
The above code, finds the HyperLink control in the MasterPage with the FindControl method, if the HyperLink control exists, the we can changes the NavigateUrl and the Text property from the Child or content pages.
Post New Tips/Tricks
View all Tips/Tricks
Featured Resources:
The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks - Free 158 Page Preview
Get the most out of this complete question-and-answer book on JavaScript.
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
100% Free Subscription until Stock lost.
View complete list.
Sponsored by
Home
About us
Contact Us
Links
Advertise
Privacy Policy
Copyright ©
2010
. www.AspdotnetCodes.com. All rights reserved.