Re: can I define custom colors?
- From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
- Date: Sun, 09 Mar 2008 06:03:55 GMT
Thanks Steven,
I learned how to set up a global resource, and set color names and values there. Then I was able to use these in a control as you described (except that it used double quotes as opposed to single quotes: BackColor="<%$ Resources:colors, color1 %>" )
And actually, I would like to use these named colors in the definition of CSS elements, but how can I specify an expression bound value in the CSS file? Since I'm wanting to define site-wide colors, to be used in the style ***.
I tried using a style *** definition like background-color: "<%$ Resources:Resource, color1 %>";
which would be similar to how it is used on a control, but this isn't accepted.
Is there a special format to bind a style*** color to a resource?
thanks,
""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message news:Mx$sKbBgIHA.4672@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Jrl,
As for defining some custom colors for using in aspx page, I think it is
still better to use css for client-side html elements since there is no
particular html standard approachs that can help define custom colors only.
For controls that can utilize asp.net server-side expression, you can
consider put your custom colors into a global resource file(resx) and use
resource expression to embed color into control property. e.g.
==============
<asp:Button ID="btnSet" runat="server" ... BackColor='<%$
Resources:colors, color1 %>' />
==============
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
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response
from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up 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.71rgb
From: "jrl" <jrl@xxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.vsnet.general
Subject: can I define custom colors?
Is there any way to define a custom color, in the code files of a web site
project?
I'd like to be able to define a pallette, using my own names, and then be
able to use those names in aspx files.
I know I can define styles, and use CSS on controls. But it seems like I
should be able to define a color name, and have it interpreted into the
during rendering.
For example, it would be something like:
color sage=(A0, B0, C0); // defining the color name
<body bgcolor=sage> //in the aspx
.
- Follow-Ups:
- Re: can I define custom colors?
- From: "Steven Cheng"
- Re: can I define custom colors?
- References:
- can I define custom colors?
- From: jrl
- RE: can I define custom colors?
- From: "Steven Cheng"
- can I define custom colors?
- Prev by Date: ASP.NET 2.0 Solution on a OffLine Synchronized Network Drive
- Next by Date: strange security role issue
- Previous by thread: RE: can I define custom colors?
- Next by thread: Re: can I define custom colors?
- Index(es):