modify master page from sub page in run time

Discussion in 'ASP .Net' started by =?Utf-8?B?Tmljaw==?=, Nov 9, 2006.

  1. 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
     
    =?Utf-8?B?Tmljaw==?=, Nov 9, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
     
    Eliyahu Goldin, Nov 9, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
     
    =?Utf-8?B?Tmljaw==?=, Nov 9, 2006
    #3
  4. If you post the code, it will be easier to find the problem.

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


    "Nick" <> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:...
    >> > 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

    >>
    >>
    >>
     
    Eliyahu Goldin, Nov 12, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    1,142
    William Brogden
    Aug 5, 2004
  2. =?Utf-8?B?bXNj?=
    Replies:
    2
    Views:
    560
    =?Utf-8?B?bXNj?=
    Aug 15, 2006
  3. Ben
    Replies:
    2
    Views:
    955
  4. Pierre Yves
    Replies:
    2
    Views:
    524
    Pierre Yves
    Jan 10, 2008
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,170
    Lawrence D'Oliveiro
    May 20, 2011
Loading...

Share This Page