Re: calling style sheets
- From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
- Date: Mon, 10 Mar 2008 02:53:19 GMT
Ok, I have read the articles you recommended, thanks. I am still getting the error
"Theme is not valid on a master page. However, the visual
designer accepts this attribute while you are editing the master page."
The syntax I am using is
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" EnableTheming="true" Theme="rosy" %>
"rosy" refers to a folder under App_Themes, containing 3 css files.
Am I doing something wrong still?
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message news:Mq%23lbClgIHA.4672@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Jrl,
Thanks for your reply.
It seems there is some misunderstanding here.
In the page's "Theme" attribute, you should assign the name of the
Theme(rather than path). Therefore, for your case, you've put a theme named
"rosy" under App_Themes folder (/App_Themes/rosy), you should use the
following syntax to reference this theme in page:
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" EnableTheming="true"
Theme="rosy" %>
Also, for stylesheets, as I mentioned in previous thread, you do not need
to explicitly reference the style*** in page, you just need to put those
stylesheets(you want to use in page) under the Theme folder (the
/App_Themes/rosy/.. in your case here). When you applied the "rosy" theme
to page, it will automatically link those stylesheets in page's html
output(you can verify it in your client browser's viewsource).
Also, I suggest you read some articles or reference about using Theme in
ASP.NET, that'll help you understand how it works better.
Best regards,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we
can improve the support we provide to you. Please feel free to let my
manager know what you think of
the level of service provided. You can send feedback directly to my manager
at: msdnmg@xxxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------Newsgroups: microsoft.public.vsnet.general<op3Aj.53393$w94.4716@pd7urf2no> <dvT#icCgIHA.6844@xxxxxxxxxxxxxxxxxxxxxx>
References: <d53Aj.53475$pM4.21522@pd7urf1no>
In-Reply-To: <dvT#icCgIHA.6844@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: calling style sheets
is
I tried using the named theme as you suggest, but got an error because itfor a master page.the
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" EnableTheming="true"
Theme="~/App_Themes/rosy/screen.css" %>
Error: "Attribute Theme is not valid on a master page. However, the visual
designer accepts this attribute while you are editing the master page."
But this might be an unrelated issue, since what I'm trying to do is usealternate method of loading style***some
for example: <link rel="Style***" type="text/css" media="screen"
href="~/App_Themes/rosy/screen.css" />
And I want to load three stylesheets (one for each type of media: screen,
print, and handheld).
How can I load multiple stylesheets with this alternate method?
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:dvT%23icCgIHA.6844@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi jrl,
From your description, you're using ASP.NET Theme feature and include%>css style sheets in Theme (which will be applied on page), however, you
found the css class can not be resolved on page, correct?
According to the App_Themes folder and style*** path (also the <link
...>
tag syntax), I found the following problems:
** For ASP.NET theme, you need to assigne a certain Theme value for page
in
addition to enabling Theme, e.g.
<%@ Page Language="C#" ............ EnableTheming="true" Theme="Theme1"e.g.
** You can add multiple Themes into App_Themes folder and each theme has
all its content(skins or stylesheets) in the subfolder of their name.
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
/App_Themes/
/Theme1
stuffs for Theme1
/Theme2
stuffs for Theme2
** For css stylesheets, if you want a certain Theme include some css
styles, just put the css style*** file into the folder of that Theme.
And
at runtime the page will automatically reference those css stylesheets(as
long as you've applied the theme on that page):
here are some further articles about using Theme in ASP.NET:
#ASP.NET Themes and Skins Overview
http://msdn2.microsoft.com/en-us/library/ykzx33wh.aspx
#Themes In ASP.NET 2.0
http://www.odetocode.com/Articles/423.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we
can improve the support we provide to you. Please feel free to let my
manager know what you think of
the level of service provided. You can send feedback directly to my
manager
at: msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
issuesications.
Note: The MSDN Managed Newsgroup support offering is for non-urgentfollowwhere an initial response
from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
enablethemingup response may take
approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump
analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support
Engineer by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------X-Trace-PostClient-IP: 70.67.40.71
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.vsnet.general
Subject: Re: calling style sheets
value
Sorry, I didn't make it clearer that the error "The class or CssClassis not defined" comes up like a tool tip when I hover over the CssClass,property
like over pageheader in the following code:
<div class = "pageheader" >
where pageheader is defined in the css style*** as
.pageheader
{
background-color: #F3F194;
color: #5A5AA5;
}
Also, I notice that when I used the enabletheming, I could set theof a control, in the properties panel, and select the cssclass from a
dropdown. Now that I use the linked style***, I don't get any style
options in the properties panel for any control.
So how can I use the linked reference to the style*** (<link
rel="Style***" ...>), and still get the utility I had with
(<%@ Master EnableTheming="true" ....>)?implements
"jrl" <jrl@xxxxxxxxxxxxxxxx> wrote in message
news:d53Aj.53475$pM4.21522@xxxxxxxxxxxx
At first I learned to call a style *** by the command
EnableTheming, as in
<%@ Master EnableTheming="true" Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
Using this form to call the style *** in the App_Themes folder worked
fine.
But then I needed to break my style*** into smaller chunks, so it was
recommended that I use the following form within the head section.
<link rel="Style***" type="text/css" media="screen"
href="~/App_Themes/screen.css"
Now I notice the references to styles, are generating an interpreter
warning "The class or CssClass value is not defined" when I view the
source code, even though it does load the linked style*** and
somethingthe styles when it generates the webpage.
Is this normal? (that it would warn this error) or am I missingin order to use this function?
.
- Follow-Ups:
- Re: calling style sheets
- From: jrl
- Re: calling style sheets
- References:
- calling style sheets
- From: jrl
- Re: calling style sheets
- From: jrl
- Re: calling style sheets
- From: "Steven Cheng"
- Re: calling style sheets
- From: jrl
- Re: calling style sheets
- From: "Steven Cheng"
- calling style sheets
- Prev by Date: Re: VS 2008 Pro Trial Download
- Next by Date: Re: calling style sheets
- Previous by thread: Re: calling style sheets
- Next by thread: Re: calling style sheets
- Index(es):
Loading