Re: calling style sheets
- From: stcheng@xxxxxxxxxxxxxxxxxxxx ("Steven Cheng")
- Date: Wed, 12 Mar 2008 02:04:01 GMT
Hi Jrl,
Thanks for the followup.
Yes, I agree that there are some more UI specific parts that I'm not quite
good at(I mainly focus on the code logic part). I've read that thread,
seems there is some design-time css validation problem in VS 2008 as the
customer in the forum thread indicate. I suggest you submit this problem as
a issue report to our product feedback center:
https://connect.microsoft.com/feedback/default.aspx?SiteID=210
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
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>
In-Reply-To: <julL03xgIHA.4200@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: calling style sheets
theme
Thanks for persevering with this issue. It's not that I don't want to use
"EnableTheming=true", its that it doesn't provide the functionality I am
seeking. I say this because of your note that one needs to specify the
on the content page. I'm trying to avoid that, just using the master page.class
And, as mentioned, each of the css share similar classes, so I need to use
the media tag, which isn't called with the theming approach.
Anyway, I was able to use both of the forms you suggested. Although they
both work, in terms of being able to apply the css styling, there is no
effect in terms of the problems I first mentioned. The problem was that,
when I use multiple css files, (each related to a different media, but
sharing many of the same classes), then Visual Studio 2008 generates a
warning on every use of any of the styles. The warning again is, "the
or CssClass value is not defined". It generates this warning, even thoughit
is using the style *** as intended.file
I explored this issue on the asp.net forum as well,
(http://forums.asp.net/t/1231590.aspx). There we discovered that this
warning only occurs in Visual Studio 2008. The same basic code does not
generate a warning in VS 2005.
Maybe I discovered a bug!
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:julL03xgIHA.4200@xxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for your reply Jrl,
So you do not want to page to "EnableTheming=true" and automatically link
all those css stylesheets in Theme folder?
If you want to explicitly reference the css stye*** and use a "~/ ..."
based url(which is ASP.NET application specific path), you can consider
the
following approah:
#1 make sure <head> is not runat ="server" and use inline code to inject
the path of the css style:
============
<head>
...
<link rel="Style***" href='<%=
Page.ResolveUrl("~/App_Themes/Theme1/other***.css") %>' />
============
#2 or you can let <head> ast "runat=server" and use codebehind to add the
css style reference.
=====================
<head runat="server" >
protected void Page_Load(object sender, EventArgs e)
{
HtmlLink csslink = new HtmlLink();
csslink.Attributes["type"] = "text/css";
csslink.Attributes["rel"] = "style***";
csslink.Attributes["href"] =
Page.ResolveUrl("~/App_Themes/Theme1/other***.css");
Page.Header.Controls.Add(csslink);
}
=============================
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.
--------------------
X-Trace-PostClient-IP: 70.67.40.71some
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.vsnet.general
Ok... As they say 'back to the drawing board' !
My original goal was to create media sets in one big css file, but for
reason the length of the css file created problems with a css validation
tool. Therefore, I tried to break the css file into separate media files.
Thats when it was suggested that I could stop using the enabletheming
approach, and begin using an alternate approach, where I call the css
cssexplicitly, as in <link rel="Style***" type="text/css" media="screen"files,
href="~/App_Themes/rosy/screen.css" />
Do you think that approach could work, to allow me to call three css
in the master page? and deal with the error "The class or CssClass valueis
not defined" that results when I use this linking format?
If not, can you suggest any method that would allow allow me to call 3
Themefiles into the master page?
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:WRGgNdngIHA.1500@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Jrl,
The behavior you got is correct. Though you can only specify which
setto
use at content page level(and only one theme for each page), you can
the"EnableTheming" at multiple level(give you different granularity of
control
on Theme). You can set EnableTheming on content page, or on Master
Page
or even on ascx usercontrol.
Actually, you can consider Master page as a particular usercontrol.
Therefore, you need to set "EnableTheming = true" on master page so as
to
make the Theme/style on it work.
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.
--------------------
X-Trace-PostClient-IP: 70.67.40.71
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
In-Reply-To: <jRLemzmgIHA.4672@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: calling style sheets
Great! I'm sure we're getting closer now.
I have the code behind of the masterpage (masterpage.master.cs) with
"rosy"hasfollowing:EnableTheming="true"
public partial class site : System.Web.UI.MasterPage
{
protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "rosy";
}
}
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
// content removed here, just wanted to show the structure of
keeping the page_load and Page_PreInit separate.
}
}
In the masterpage.master I use the form
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage"
%>
I also tried removing EnableTheming="true".
However, although it compiles fine, this setup results in a page which
Masterno style *** applied.
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:jRLemzmgIHA.4672@xxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for your quick reply Jrl,
This is my fault here. I should have pointed out the problem that
'System.Web.UI.MasterPage'"Theme"page does not support "Theme" property, therefore, you can not add
attribute in <%@ Master %> directive.
For declarative Theme setting ,you need to set the "Theme" attribute
in
content page. Or you can consider programmatically set Theme for a
page(in
master page). e.g.
================
public partial class site : System.Web.UI.MasterPage
{
protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "my theme";
}
...............
==============
#Note: you can only programmatically set Theme in PreInit event since
that's the earliest event you can get to do this.
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.
--------------------
X-Trace-PostClient-IP: 70.67.40.71
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.vsnet.general
In-Reply-To: <zo1Bj.65287$w94.58704@pd7urf2no>
Subject: Re: calling style sheets
Further, the error when I compile is
Error 4 Error parsing attribute 'theme': Type
themegettingdoes not have a public property named 'theme'.
"jrl" <jrl@xxxxxxxxxxxxxxxx> wrote in message
news:zo1Bj.65287$w94.58704@xxxxxxxxxxxx
Ok, I have read the articles you recommended, thanks. I am still
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
neednamed
"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
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
myThemetheme
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
commentsin
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
myand
suggestions about how we
can improve the support we provide to you. Please feel free to let
manager know what you think of
the level of service provided. You can send feedback directly to
nomanager
at: msdnmg@xxxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers
theitrights.
--------------------
Newsgroups: microsoft.public.vsnet.general<op3Aj.53393$w94.4716@pd7urf2no>
References: <d53Aj.53475$pM4.21522@pd7urf1no>
<dvT#icCgIHA.6844@xxxxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <dvT#icCgIHA.6844@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: calling style sheets
I tried using the named theme as you suggest, but got an error
because
is
for a master page.
<%@ 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,
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifhowever,page."visual
designer accepts this attribute while you are editing the master
includescreen,the
But this might be an unrelated issue, since what I'm trying to do
is
use
alternate method of loading style***
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:
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
some
css style sheets in Theme (which will be applied on page),
foryou
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
myname.Theme="Theme1"page
in
addition to enabling Theme, e.g.
<%@ Page Language="C#" ............ EnableTheming="true"
%>
** You can add multiple Themes into App_Themes folder and each
theme
has
all its content(skins or stylesheets) in the subfolder of their
commentsTheme.e.g.
/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
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
myand
suggestions about how we
can improve the support we provide to you. Please feel free to
let
manager know what you think of
the level of service provided. You can send feedback directly to
manager
at: msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
andnon-urgentications.
Note: The MSDN Managed Newsgroup support offering is for
eachissues
where an initial response
from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that
atreachfollow
up response may take
approximately 2 business days as the support
professional working with you may need further investigation to
complexthe
most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or
withproject analysis and dump
analysis issues. Issues of this nature are best handled working
a
dedicated Microsoft Support
Engineer by contacting Microsoft Customer Support Services (CSS)
no
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers
fromCssClassrights.
--------------------
X-Trace-PostClient-IP: 70.67.40.71
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.vsnet.general
Subject: Re: calling style sheets
Sorry, I didn't make it clearer that the error "The class or
value
is not defined" comes up like a tool tip when I hover over theproperty
CssClass,
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
the
of a control, in the properties panel, and select the cssclass
a
styledropdown. Now that I use the linked style***, I don't get any
itenablethemingoptions 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" ....>)?
"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
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***
missingimplements
the styles when it generates the webpage.
Is this normal? (that it would warn this error) or am I
something
in order to use this function?
.
- 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"
- Re: 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"
- Re: calling style sheets
- From: jrl
- Re: calling style sheets
- From: "Steven Cheng"
- Re: calling style sheets
- From: jrl
- calling style sheets
- Prev by Date: Re: calling style sheets
- Next by Date: Re: Visual Studio 2008 compatibility
- Previous by thread: Re: calling style sheets
- Next by thread: Re: MSDiscoCodeGenerator failed. Initialization failure.
- Index(es):