I'm trying to add a style to the Page.Header programmatically to achieve the following:
<head>
<style type="text/css">
input.myclass { text-transform:uppercase;
}
</style>
</head>
But all I get is:
<head>
<style type="text/css">
input.myclass { }
</style>
</head>The code I'm using for this is the following:
public partial
class Default3
: System.Web.UI.Page
{
protected void Page_Load(object
sender, EventArgs e)
{
Style style = new Style();
style.GetStyleAttributes(null).Add("text-transform",
"uppercase");
this.Page.Header.StyleSheet.CreateStyleRule(style, null,
"input.myclass");
}
}
So this isn't the right way. Who can show me the way? How must I add this style to the header programmatically?