By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,983 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,983 IT Pros & Developers. It's quick & easy.

Programmatically Applying Style Sheets....

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.