![]() |
|
|
|||||||
![]() |
ASP Net - Change Property on Master Page at runtime? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Howdy,
I have my master page, and I would like to change the background CSS class per the content page. Only the home page has a different background style, all other pages are using the same. I know I can create a new master page, but I'd like to just change the master page from the content page if possible. thanks! -- David Lozzi dlozzi@(remove)delphi-ts.com www.delphi-ts.com David Lozzi |
|
|
|
|
#2 |
|
Posts: n/a
|
Hi David,
Every page has a "Master" property. You can use this property to change the contents of master page. "David Lozzi" wrote: > Howdy, > > I have my master page, and I would like to change the background CSS class > per the content page. Only the home page has a different background style, > all other pages are using the same. I know I can create a new master page, > but I'd like to just change the master page from the content page if > possible. > > thanks! > > -- > David Lozzi > dlozzi@(remove)delphi-ts.com > www.delphi-ts.com > > > =?Utf-8?B?VHVzaGFy?= |
|
|
|
#3 |
|
Posts: n/a
|
how to I select the class of the body? Also, would it make sense to check it
from the master page instead of per content page? So put this on the master page If content.Page.ToString = "ASP.default_aspx" then use one background else use other end if just how do i get to the backjground properties or class name of body?? Thanks!! David Lozzi "Tushar" <> wrote in message news:3961B67C-2AD4-4F81-921D-... > Hi David, > Every page has a "Master" property. You can use this property to change > the > contents of master page. > > > > "David Lozzi" wrote: > >> Howdy, >> >> I have my master page, and I would like to change the background CSS >> class >> per the content page. Only the home page has a different background >> style, >> all other pages are using the same. I know I can create a new master >> page, >> but I'd like to just change the master page from the content page if >> possible. >> >> thanks! >> >> -- >> David Lozzi >> dlozzi@(remove)delphi-ts.com >> www.delphi-ts.com >> >> >> David Lozzi |
|
|
|
#4 |
|
Posts: n/a
|
To reference properties of the master page from a content page we must type
the master in the content page from which we make the reference... // in content page <%@ MasterType VirtualPath="~/Masters/ThreeStackedPanels.master" %> Then we can use public properties or the FindControl method to reference properties of a control // control in Master Page LinkButton navigation = Master.Page.FindControl("NavigationLinkButton") as LinkButton; navigation.CssClass = "SmokeyBlue"; -- <%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://www.metromilwaukee.com/clintongallagher/ "David Lozzi" <> wrote in message news:... > Howdy, > > I have my master page, and I would like to change the background CSS class > per the content page. Only the home page has a different background style, > all other pages are using the same. I know I can create a new master page, > but I'd like to just change the master page from the content page if > possible. > > thanks! > > -- > David Lozzi > dlozzi@(remove)delphi-ts.com > www.delphi-ts.com > clintonG |
|
|
|
#5 |
|
Posts: n/a
|
got it!
thanks If cphBody.Page.ToString = "ASP.default_aspx" Then bdBody.Style("background-image") = "url(site_images/bg_home.gif)" Else bdBody.Style("background-image") = "url(site_images/bg_second.gif)" End If -- David Lozzi dlozzi@(remove)delphi-ts.com www.delphi-ts.com "David Lozzi" <> wrote in message news:ejyTf$... > how to I select the class of the body? Also, would it make sense to check > it from the master page instead of per content page? So put this on the > master page > > If content.Page.ToString = "ASP.default_aspx" then > use one background > else > use other > end if > > just how do i get to the backjground properties or class name of body?? > > Thanks!! > > David Lozzi > > "Tushar" <> wrote in message > news:3961B67C-2AD4-4F81-921D-... >> Hi David, >> Every page has a "Master" property. You can use this property to change >> the >> contents of master page. >> >> >> >> "David Lozzi" wrote: >> >>> Howdy, >>> >>> I have my master page, and I would like to change the background CSS >>> class >>> per the content page. Only the home page has a different background >>> style, >>> all other pages are using the same. I know I can create a new master >>> page, >>> but I'd like to just change the master page from the content page if >>> possible. >>> >>> thanks! >>> >>> -- >>> David Lozzi >>> dlozzi@(remove)delphi-ts.com >>> www.delphi-ts.com >>> >>> >>> > > David Lozzi |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| master page does not change due to preinit event not firing | franchise63 | General Help Related Topics | 0 | 02-13-2008 09:18 AM |
| master page & app_theme folder doesn't work | dummies2 | General Help Related Topics | 0 | 09-04-2007 05:41 PM |
| Classic Original Broadcasts Trading List - Updated ( w/o/c ) | porkys1982@sbcglobal.net | DVD Video | 0 | 12-05-2005 03:38 AM |
| Classic Original Broadcasts Trading List - Updated ( w/o/c ) | porkys1982@sbcglobal.net | DVD Video | 0 | 11-19-2005 04:46 PM |
| Original Airings : The A-Team , M*A*S*H , Taxi , Barney Miller , WKRP | porkys1982@sbcglobal.net | DVD Video | 0 | 08-15-2005 03:09 AM |