Working with Themes in ASP.NET 2.0
page 7 of 10
by SANJIT SIL
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 44644/ 148

Working with Themes Programmatically

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>

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-12-05 6:47:07 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search