473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

modify master page from sub page in run time

Hi ALL:

i have a master page and two sub pages and master page has a menu with two
links which point to two sub page.
what i wanna to do is that when the sub page shows the link in the menu
change colour.

so how do i chane the colour of master page from sub page?

Cheers

Nick
Nov 9 '06 #1
3 4599
Nick,

You can make a public property MenuColor in the master page. The content
pages can access it as this.Master.MenuColor. You will need to add a
<%@ MasterType virtualpath="~/myMasterPageName.master" %>

direcive to the content file. The master page can change the menu color in
the MenuColor's "set" part.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Nick" <Ni**@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Hi ALL:

i have a master page and two sub pages and master page has a menu with two
links which point to two sub page.
what i wanna to do is that when the sub page shows the link in the menu
change colour.

so how do i chane the colour of master page from sub page?

Cheers

Nick

Nov 9 '06 #2
hi Eliyahu Goldin.

Thanks for your reply, which is really helpful.

i actually make it works by using function instead of property.

because i got error like lack of set access when i use property set .

do you know why?

thanks

nick

"Eliyahu Goldin" wrote:
Nick,

You can make a public property MenuColor in the master page. The content
pages can access it as this.Master.MenuColor. You will need to add a
<%@ MasterType virtualpath="~/myMasterPageName.master" %>

direcive to the content file. The master page can change the menu color in
the MenuColor's "set" part.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Nick" <Ni**@discussions.microsoft.comwrote in message
news:35**********************************@microsof t.com...
Hi ALL:

i have a master page and two sub pages and master page has a menu with two
links which point to two sub page.
what i wanna to do is that when the sub page shows the link in the menu
change colour.

so how do i chane the colour of master page from sub page?

Cheers

Nick


Nov 9 '06 #3
If you post the code, it will be easier to find the problem.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Nick" <Ni**@discussions.microsoft.comwrote in message
news:AF**********************************@microsof t.com...
hi Eliyahu Goldin.

Thanks for your reply, which is really helpful.

i actually make it works by using function instead of property.

because i got error like lack of set access when i use property set .

do you know why?

thanks

nick

"Eliyahu Goldin" wrote:
>Nick,

You can make a public property MenuColor in the master page. The content
pages can access it as this.Master.MenuColor. You will need to add a
<%@ MasterType virtualpath="~/myMasterPageName.master" %>

direcive to the content file. The master page can change the menu color
in
the MenuColor's "set" part.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Nick" <Ni**@discussions.microsoft.comwrote in message
news:35**********************************@microso ft.com...
Hi ALL:

i have a master page and two sub pages and master page has a menu with
two
links which point to two sub page.
what i wanna to do is that when the sub page shows the link in the menu
change colour.

so how do i chane the colour of master page from sub page?

Cheers

Nick



Nov 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: ericgla | last post by:
I am creating a web app using asp.net 2.0 where all pages are based a single master page. On some of the aspx pages I need to add javascript to the head tag in order to use Google maps. I tried...
20
by: M.Siler | last post by:
Let me first by saying I am NOT a .net programmer, but am very skilled with ASP, JavaScript, HTML, DHTML, Flash development. I've been reading through posts here about Frames vs. Master Pages and...
1
by: Fred Nelson | last post by:
I have a question regarding page caching in a C# Web App that I'm developing. I have used page caching successfully in VS2003 at the page level - and it also works the same in VS2005. I have...
1
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
1
by: Dabbler | last post by:
I have some hyperlink controls on a master page I need to disable till my user has made some selections in a user control on a page based on the master page. How do I reference the Hyperlink...
2
by: igotyourdotnet | last post by:
Is there a way to prevent the master page to reload every time the user makes a selection off of the menu? I want to give it a "Frame" like appearance were only the content section changes with a...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.