Advertisement

05.05.2008 at 08:41PM PDT, ID: 23378455
[x]
Attachment Details

How to read, update, or manipulate controls in the Master Page from a web page that uses the Master Page

Asked by sil-olis in Visual Studio .NET 2005, Visual Studio 2008

Tags: Micrososoft, ASP.Net, v 3.5 using Visual Web Developer 2008 Express, Using VB.Net in code behind, ASP.Net and VB.Net code behind

I have a corporate master page that has some navigation controls, and a couple of text boxes that are hidden (containing user information).  Once I am working in a web page that uses this Master Page (MasterPageFile="~/CIP_Header.master"), I cannot figure out how to (a) reference and (b) read/write to/or set properties of the controls in the Master Page.  

A. For instance, there are several standard navigation buttons in the Master Page.  When a page using the Master Page is opened, I would like to change the font of the button corresponding to the current page, so that the text becomes bold and the color changes to red.  In the Master Page, the button control is named btnProgram, so how do I reference and change the properties from a form that uses this Master Page?

B.  There are also two hidden textboxes in the Master Page, named tbUserName and tbUserEntity.  How do I reference these controls from a web page using this Master Page so that I can read or update the text property in these two textboxes?

I am using VB/Net in the code behind.

Thanks for your help!Start Free Trial
[+][-]05.05.2008 at 09:37PM PDT, ID: 21504799

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 12:18AM PDT, ID: 21505330

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.06.2008 at 12:10PM PDT, ID: 21510046

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, Visual Studio 2008
Tags: Micrososoft, ASP.Net, v 3.5 using Visual Web Developer 2008 Express, Using VB.Net in code behind, ASP.Net and VB.Net code behind
Sign Up Now!
Solution Provided By: funwithdotnet
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628