ASP.NET
  Home arrow ASP.NET arrow Page 5 - The Beauty of ASP.NET 2.0 Themes in Visual...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

The Beauty of ASP.NET 2.0 Themes in Visual Studio 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 54
    2006-04-10

    Table of Contents:
  • The Beauty of ASP.NET 2.0 Themes in Visual Studio 2005
  • A simple demonstration of ASP.NET 2.0 skins and themes
  • How to create and apply different skin elements to the same Web Server Control
  • How to create and apply Cascading Style Sheets to an ASP.NET 2.0 theme
  • How to apply ASP.NET 2.0 themes at runtime: creating theme and skin
  • How to apply ASP.NET 2.0 themes at runtime: working with code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Beauty of ASP.NET 2.0 Themes in Visual Studio 2005 - How to apply ASP.NET 2.0 themes at runtime: creating theme and skin


    (Page 5 of 6 )

    We can also set the theme of a page during run time. This concept is useful for allowing users to customize the page according to their preference or interest.

    Let us go through an example of setting a theme during runtime (we shall use the same design and controls discussed in previous sections)

    1.       Modify the properties of the button as follows:

    a.       Text=”First Theme”

    b.       ID=”btnFirstTheme”

    2.       Place another button (ASP.NET server control) and modify the following properties:

    a.       Text=”Second Theme”

    b.       ID=”btnSecondTheme”

    3.       Create one more Theme (named “SecondTheme”) by just following the steps discussed in the previous sections. By this time, your solution explorer should look something like the following image, fig7.

    4.       Add a new skin (“SkinFile.skin”) to the newly created theme (“SecondTheme”) by just following the steps discussed in the previous sections.

    5.       Open “SkinFile.skin” file and type the following code:

    <asp:Button
     runat="server"
     BackColor="AliceBlue"
     BorderColor="Black"
     BorderStyle="Solid"
     BorderWidth="1px"
     />
    <asp:Button
    runat="Server"
    SkinId="btnSecondTheme"
    BackColor="#FFE0C0"
    BorderColor="#C04000"
    BorderStyle="Solid"
    BorderWidth="1px"
    />
     
    <asp:ListBox
     runat="server"
     BackColor="green"
     BorderColor="white"
     BorderStyle="Solid"
     BorderWidth="1px"
     />
     
    <asp:ListBox
     runat="server"
     SkinId="lstSkinBlue"
     BackColor="steelblue"
     BorderColor="black"
     BorderStyle="Solid"
     BorderWidth="1px"
    />

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hello guys. Now you can get into ASP.NET 2.0 themes using Visual Studio 2005 with...
       · how do i apply a theme at runtim to all the pages of my site (without explicitly...
     

    ASP.NET ARTICLES

    - More Advanced ASP.NET 3.5 Functions and Subr...
    - ASP.NET 3.5 Functions and Subroutines
    - Coding an IQ Test with Conditionally Driven ...
    - Developing Conditionally Driven Event Handle...
    - ASP.NET 3.5 Debugging Using Visual Web Devel...
    - Understanding Event Handlers in ASP.NET 3.5
    - Building a Web Form in ASP.NET and PHP: a Co...
    - Inserting Data into a Microsoft SQL 2008 Dat...
    - Creating an ASP.NET Dynamic Web Page Using M...
    - Retrieving Data from Microsoft SQL Server 20...
    - Building ASP.NET Web Forms to Use a MySQL Da...
    - Creating an ASP.NET Database using MS SQL 20...
    - Building an ASP.NET Website Using Include Ta...
    - Create ASP.NET Web Forms to Use a Microsoft ...
    - Editing Web Design Layout in Visual Web Deve...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek