.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Apply Themes at Runtime in ASP.Net

Posted By:Sasi Prabhu       Posted Date: July 06, 2011    Points: 40    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Change the Themes Programmatically at runtime in asp.net.
 


Create a Theme & Skin File:

Right Click the solutionexplorer -> Add NewItem -> Skin File

Enter FileName.skin and Click on Ok.




The Themes can be applied to the page in the Event Page_PreInit()


To Apply Theme to the Page


Page.Theme="ThemeName";



Coding :

protected void Page_PreInit(object sender,EventArgs e)
{
Page.Theme="Default";
}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend