.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

Page themes And Skins Change in Asp.net

Posted By:Dinkar       Posted Date: April 11, 2011    Points: 40    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

This is important for to change to page Theme
 

 Page themes And Skins Change in Asp.net:


Step 1):Take Asp.net web Form and Dropdownlist


step2) :First you have to add  App_Themes folder in that you have to Add Some skin and css,and images.
like follow exa:


{

 
 
 
 
 
 
 
 
 


 
 
 
 


 
 
 
 


 
 
 
 
 
 
 
 


 
 
 
 
 
 
 


 
 
 
 
 
 
 


 
 
 
 
 
 


 
 
 
 
 
 
 
 


 
 
 
  
 

 
 
 
 


 
 
 
 
 
 
 


 
 
 
 


 
 
 
 
 
 
 
 


 
 
 
 
 
 


}

Now you have to write code under Page_PreInit Event
{
protected void Page_PreInit(object sender, EventArgs e)
    {
        string theme = "";
        if (Page.Request.Form.Count > 0)
        {
            theme = Page.Request["Themes"].ToString();
            if (theme == "Default2")
            {
                theme = "";
            }
        }
        this.Theme = theme;
    }
}
Now run Application Theme will change



     

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