Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > modify master page from sub page in run time

Reply
Thread Tools

modify master page from sub page in run time

 
 
=?Utf-8?B?Tmljaw==?=
Guest
Posts: n/a
 
      11-09-2006
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
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-09-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Tmljaw==?=
Guest
Posts: n/a
 
      11-09-2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-12-2006
If you post the code, it will be easier to find the problem.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


"Nick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
"Bind" event in Master page object to sub in content page. Fresno Bob ASP .Net 1 11-01-2008 08:21 PM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
How to Run sub in contentplaceholder from master page =?Utf-8?B?bXNj?= ASP .Net 2 08-15-2006 08:18 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments