Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically set the label in master page depending on content page

Status
Not open for further replies.

ITking2009

Programmer
Aug 4, 2009
23
US
Hi,
Here's what i want to achieve
I have a master page which has to display the page we are on (content page) somewhere on the master page.
For example if we are on login page it should display login, if we are on feedback page the master page should display feedback etc.

I tried using label but then couldn't set the property in the content page or content page.cs file

Can anyone direct me how to set a master page property in content page or if there is another approach i need to take.

Thanks
PS: I have to do this in master page instead of moving it to content pages because its a part of the page which is common among all the pages.
 
You have to expose a public property on the master page. Then you can set it from any content page.
 
Thanks Jbenson001,
but i dont know that for a lable how do i expose a public property?
can you give me an example?
Thanks.
 
you can define the title of the page in the content place holder tag. this will show in the browser's title bar, not the actual page.

you could also use a bread crumb trail (i think there is a webform control for this.) or pull the Title property from the master page and put the title in the page itself.

exposing public properties and down casting objects "works" but breaks the concept of encapsulation and can become a pain to maintain when you need to alter the master page.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top