ASP.Net 2.0 - how to add custom style into page headerin code

  • Thread starter Thread starter Sergey Poberezovskiy
  • Start date Start date
S

Sergey Poberezovskiy

Hi,

What is the "right" way to create the following css rule in a page header:
<style>
..myRule{text-align:right;padding-right:10px;}
</style>

I know that you can add simple styles as follows:
this.Page.Header.StyleSheet.CreateStyleRule(style, this.Page,
".mySimpleRule");
but then I am not sure how to set text-align, padding or similar styles to a
System.Web.UI.WebControls.Style object

I am trying to avoid putting literal into my header and altering its content.

Any help is appreciated.
 
Hi,

What is the "right" way to create the following css rule in a page header:
<style>
.myRule{text-align:right;padding-right:10px;}
</style>

I know that you can add simple styles as follows:
this.Page.Header.StyleSheet.CreateStyleRule(style, this.Page,
".mySimpleRule");
but then I am not sure how to set text-align, padding or similar styles to a
System.Web.UI.WebControls.Style object

I am trying to avoid putting literal into my header and altering its content.

Any help is appreciated.

http://groups.google.com/group/micr....aspnet/browse_thread/thread/c2200e6aec7f6062
 
Back
Top