473,387 Members | 1,545 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,387 software developers and data experts.

Programmatically Applying Style Sheets....

Hi Guys,

Does anyone know of an easy way of doing this...

****************** ASP.NET/VB.NET *********************
With MenuSystem.MenuHeaderStyle.Style
.Add("font-family", "verdana")
.Add("font-size", "70%")
.Add("height", "15px")
.Add("background", "#9999ff")
.Add("border", "0px solid gray")
.Add("padding-left", "20px")
.Add("padding-Top", "7px")
.Add("padding-Bottom", "7px")
.Add("padding-Right", "20px")
.Add("cursor", "hand")
.Add("border-top", "0px solid black")
.Add("font-align", "center")
End With
************************************************** *****

I'm dynamically creating user controls that contain web controls which
are also created dynamically. Creating controls this way kindof made
things really complecated and the only way I could apply styles to them
was to programmatically do it (above). Is there a way that i could
somehow map a stylesheet element through code?

Let me know if you need further clarification.

Cheers,

Soulcode.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 1726
YourControl.Attributes.Add("style", "font-family:verdana; ...");

-Jason

soulcode wrote:
Hi Guys,

Does anyone know of an easy way of doing this...

****************** ASP.NET/VB.NET *********************
With MenuSystem.MenuHeaderStyle.Style
.Add("font-family", "verdana")
.Add("font-size", "70%")
.Add("height", "15px")
.Add("background", "#9999ff")
.Add("border", "0px solid gray")
.Add("padding-left", "20px")
.Add("padding-Top", "7px")
.Add("padding-Bottom", "7px")
.Add("padding-Right", "20px")
.Add("cursor", "hand")
.Add("border-top", "0px solid black")
.Add("font-align", "center")
End With
************************************************** *****

I'm dynamically creating user controls that contain web controls which
are also created dynamically. Creating controls this way kindof made
things really complecated and the only way I could apply styles to them
was to programmatically do it (above). Is there a way that i could
somehow map a stylesheet element through code?

Let me know if you need further clarification.

Cheers,

Soulcode.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

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

Similar topics

2
by: John | last post by:
I want to programmatically read a CSS file into an object model and access the style class name and style attributes. Anyone can let me know if there is an open source, or point me the right...
1
by: | last post by:
I'm wondering if it's possible, outside of the declaration of an ASP.NET 2.0 GridView, to programmatically style individual columns. For example, I might want to make the text in a particular...
0
by: John | last post by:
I want to programmatically read a CSS file into an object model and access the style class name and style attributes. Anyone can let me know if there is an open source, or point me the right...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
1
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style...
5
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
5
by: Nathan Sokalski | last post by:
I have css that would normally be placed in style tags in the header of the Master page that I want to add programmatically for a specific Web Content Form (the *.aspx page). How do I do this for a...
1
by: Cramer | last post by:
According to the MSDN docs, we cannot programatically create our own themes or skins: "Page and control developers do not use the ControlSkinDelegate, ControlSkin, or PageTheme classes directly....
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.