473,395 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Search for rules in HtmlHead.StyleSheet property

Hi

I'm adding rules dynamically to the HtmlHead.StyleSheet using the
CreateStyleRule method. I'd like to know how to check whether the rules
already exist first.

Thanks
Andrew
Oct 29 '07 #1
2 1621
Hi Andrew,

As for the ASP.NET Page.Header.StyleSheet property, I've performed some
research and found that this property is of an internal type, currently we
can only access and manipulate through the two interface
methods(CreateStyleRule and RegisterStyle). And the internal code logical
of "CreateStyleRule" will keep adding the new style rule into an ArrayList
and at runtime, the new rule(added later) will overwrite the former ones. I
think you can make your code logic depend on this behavior. BTW, would you
mind tell us what you'll do that require to inspect the existing rule/style
in the StyleSheet?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "J055" <j0**@newsgroups.nospam>
Subject: Search for rules in HtmlHead.StyleSheet property
Date: Mon, 29 Oct 2007 13:45:32 -0000

Hi

I'm adding rules dynamically to the HtmlHead.StyleSheet using the
CreateStyleRule method. I'd like to know how to check whether the rules
already exist first.

Thanks
Andrew
Oct 30 '07 #2
Hi Steven

The RegisterStyle method doesn't work for me as it only creates a system
names class selector name. I need to set an ID selector with a width based
on the pages currently visible UserControl. What's happening is that it's
very easy to end up with duplicate entries in the page header style element,
e.g.

#container { width:90%; }
#container { width:600px; }

It would be good if there was a way to check for the #container selector or
even better get the styles for the #container too.

I'm thinking that I may need to manage my own way of adding this to the head
element. Any suggestions would be appreciated.

Thanks
Andrew

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:jl**************@TK2MSFTNGHUB02.phx.gbl...
Hi Andrew,

As for the ASP.NET Page.Header.StyleSheet property, I've performed some
research and found that this property is of an internal type, currently we
can only access and manipulate through the two interface
methods(CreateStyleRule and RegisterStyle). And the internal code logical
of "CreateStyleRule" will keep adding the new style rule into an ArrayList
and at runtime, the new rule(added later) will overwrite the former ones.
I
think you can make your code logic depend on this behavior. BTW, would you
mind tell us what you'll do that require to inspect the existing
rule/style
in the StyleSheet?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>>From: "J055" <j0**@newsgroups.nospam>
Subject: Search for rules in HtmlHead.StyleSheet property
Date: Mon, 29 Oct 2007 13:45:32 -0000

Hi

I'm adding rules dynamically to the HtmlHead.StyleSheet using the
CreateStyleRule method. I'd like to know how to check whether the rules
already exist first.

Thanks
Andrew

Oct 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joachim Spoerhase | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I am a XSLT-beginner and i read the XSLT-recommendation of the W3C through. But I did'nt really understand section 5.5 of the latest...
0
by: AwanJohnie | last post by:
I want to display results of a search in XML on a browser. I have created a search form using HTML to accept parameters for the field "author". I want to be able to accept this parameter in the...
4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
6
by: Richard Barnet | last post by:
Dear CSS gurus, My question regarding 'the cascade' is a simple one, but one that I haven't heard anyone talk about before: When cascading (for instance, when applying two linked stylesheets),...
7
by: Marek Mänd | last post by:
When using <TABLE rules="all"> Mozilla 1.6 and previous versions draw a nasty interiour border, which doesnt go away though I have on TD's css border:none set. Is it something wrong with my...
1
by: jbj | last post by:
I am trying to make a javascript function that can rewrite javascript rules dynamically (no, not the style tag of an individual element, but the actual rule in the <head> portion of the document)....
5
by: Jens Jensen | last post by:
Hello, Does anyone know anything about how to optimise asp.net 2.0 pages for search engines? I'm thinking of a programmatic way of mapping sitemap structure to pages meta tags. Well it...
2
by: Krustov | last post by:
I wrote this a while ago and found it comes in very handy at times . For example , If you want to know what webpages use a certain stylesheet its just a matter of typing in the stylesheet name...
1
by: Jeff | last post by:
Often, a page will have more than one stylesheet. Some external and some embedded. If there are multiple rules that have *identical* selectors, will the last one always take precedence? Any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.