C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Accessing Controls on Master Pages from Content Pages


Posted Date: 25 Aug 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: MuniHemadriBabu.Jogi       Member Level: Gold
Rating:     Points: 2



Let's say you have a label called 'Label4' on your Master Page. You might want to change the text of that label, to something different, from each content page you have in your site. To do that, it's very easy:

Dim lbl As Label lbl = CType(Master.FindControl("Label4"), Label) lbl.Text = "whatever"

(of course, this is all assuming the label is OUTSIDE the ContentPlaceHolder)

Also, make sure you have this at the top of your Content page:

<%@ MasterType TypeName="TheNameOfYourMasterPage" %>




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Asp.net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Data from database into a Excel Sheet
Previous Resource: Validate username and Password using Login Control and SQL
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

UK Conference calling Company

Contact Us    Privacy Policy    Terms Of Use