In the above code the Theme has been defined at design time,
but we can work with the Theme programmatically.
Assigning the Pages’s Theme Programmatically
In Listing 12 it is illustrated how we can assign the pages'
theme programmatically.
Listing 12
<script runat =”server”>
Protected void Page_PreInit(object sender,
System.EventArgs e)
{
Page.Theme=Request.QueryString[“AppliedTheme”];
}
</script>
Assigning a Control’s SkinID Programmatically
There is another option to assign a specific server
control’s SkinID property programmatically, which is illustrated in Listing 13.
Listing 13
<script runat =”server”>
Protected void Page_PreInit(object sender,
System.EventArgs e)
{
txtThemeTest.SkinID=”txtDashed”;
}
</script>