I am new to Master Page so sorry if this question might have been answered before. My master page contains a link to my stylesheet.
However the cssclass do not get applied on my gridview located in a Content Page, why is that and what should I do to work around this?
In the application's Web.config file, set the
<pages> element to the name of the theme, either a global theme or a page theme, as shown in the following example:
Thanks for your reply but I am still very confuse.
So I have no other choices than to work with themes? Why is my regular style sheet set in my master page not available in my content pages?
Setting a theme at the Web site level applies styles (style sheet 'css' files) and skins ('skin' files) to all the pages and controls in the site. When you developed your Master Page you gave it a style sheet. To have that style sheet have precedence over
the other pages CSS properties you must tell your site (by setting Pages property in your Config file) to default to that style sheet also.
Your master page gives you a common wrapper around your other pages, it does not control the look and feel of those pages.
You cannot directly apply an ASP.NET theme to a master page. If you add a theme attribute to the
@ Master directive, the page will raise an error when it runs.
However, themes are applied to master pages under these circumstances:
If a theme is defined in the content page. Master pages are resolved in the context of content pages, so the content page's theme is applied to the master page as well.
If the site as a whole is configured to use a theme by including a theme definition in the pages element.
Master pages, being just another control inside a page, do not have a separate theme applied. Master pages use the theme specified by the page that is using them.
freedom1029
Participant
1990 Points
504 Posts
CSS of Master page not being apply on Content Pages
May 01, 2007 05:36 PM|LINK
I am new to Master Page so sorry if this question might have been answered before. My master page contains a link to my stylesheet.
However the cssclass do not get applied on my gridview located in a Content Page, why is that and what should I do to work around this?
Thank you.
rstepan
Participant
1186 Points
204 Posts
Re: CSS of Master page not being apply on Content Pages
May 01, 2007 06:15 PM|LINK
In the application's Web.config file, set the <pages> element to the name of the theme, either a global theme or a page theme, as shown in the following example:
<div class=code id=ctl00_LibFrame_ctl09_other> <div class=CodeSnippetTitleBar> <div class=CodeDisplayLanguage></div> <div class=CopyCodeButton><configuration><system.web>
<pages theme="ThemeName" />
</system.web>
</configuration></div> <div class=CopyCodeButton> </div> <div class=CopyCodeButton>For further explanation visit Microsoft's link below:</div> <div class=CopyCodeButton> </div> <div class=CopyCodeButton>http://msdn2.microsoft.com/en-us/library/0yy5hxdk.aspx</div></div></div>
Page Theme
freedom1029
Participant
1990 Points
504 Posts
Re: CSS of Master page not being apply on Content Pages
May 01, 2007 06:22 PM|LINK
Thanks for your reply but I am still very confuse.
So I have no other choices than to work with themes? Why is my regular style sheet set in my master page not available in my content pages?
rstepan
Participant
1186 Points
204 Posts
Re: CSS of Master page not being apply on Content Pages
May 01, 2007 06:40 PM|LINK
Setting a theme at the Web site level applies styles (style sheet 'css' files) and skins ('skin' files) to all the pages and controls in the site. When you developed your Master Page you gave it a style sheet. To have that style sheet have precedence over the other pages CSS properties you must tell your site (by setting Pages property in your Config file) to default to that style sheet also.
Your master page gives you a common wrapper around your other pages, it does not control the look and feel of those pages.
Themes theme masterpage change PreInit themes css themes skins
rstepan
Participant
1186 Points
204 Posts
Re: CSS of Master page not being apply on Content Pages
May 01, 2007 07:13 PM|LINK
You cannot directly apply an ASP.NET theme to a master page. If you add a theme attribute to the @ Master directive, the page will raise an error when it runs.
However, themes are applied to master pages under these circumstances:
If a theme is defined in the content page. Master pages are resolved in the context of content pages, so the content page's theme is applied to the master page as well.
If the site as a whole is configured to use a theme by including a theme definition in the pages element.
Master pages, being just another control inside a page, do not have a separate theme applied. Master pages use the theme specified by the page that is using them.