SIGN UP MEMBER LOGIN:    
ARTICLE

Quick Themes in ASP.NET

Posted by Dipa Ahuja Articles | ASP.NET Programming May 03, 2010
As you know themes is one of the interesting features of asp.net. It makes the webpage attractive.
Reader Level:
Download Files:
 

 

Introduction

As you know themes is one of the interesting features of asp.net. It makes the webpage attractive.

As explained in MSDN, A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in a Web application, across an entire Web application, or across all Web applications on a server.

Themes are usually used in social networking websites because it allow users to set their own theme for their account.

Usually we create themes by adding themes in our project set their colors, backgrounds etc.

It takes time when we want to create the website quickly and themes are necessary to add.

But how to create them quickly ?

There is one site http://www.pyzam.com/  it provides lots of themes which we can use in our asp.net website.

There you can find themes on different fields like cartoon, season, celebs etc...

Just copy the code to the WordPad that is provided from that website.

Now you have to set that code properly.

  • Background Image/Background Color

The main thing of the webpage is background color or background image that's why first you have to download the image of background and save it to your project that is provided by the pyzam's code.

  • Asp.net Controls

For asp.net controls you can do setting in the skin file.

For data controls like data list, details view etc you have to select color based on the theme particular theme.

  • Buttons

For buttons, you can select any background color, download buttons from the website or you can or you can create your own choice of button using Photoshop.

You can add css classes if required for the elements like table, h1 etc.

In my example I have created three themes using the pyzam.com, those are kitty, fairy and flower.

In the example there are 2 main files. First which is showing the themes and second where you can apply themes.

In theme.aspx you will find the list of themes that you can apply.

QuickTheme1.gif

Based on selected theme will be applied and page will be redirected to defual.aspx. Suppose if you have select fairy.

protected void ImageButton8_Click(object sender, ImageClickEventArgs e)
    {
        Session["theme"] = "Fairy";
        Response.Redirect("~/Default.aspx");
    }

Defual.aspx.cs:

protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Session["theme"] != null)
        {
            Page.Theme = Session["theme"].ToString();
        }
        else
        {
            Page.Theme = "Blue";
        }

    }

QuickTheme2.gif

Same way you can create your own favorite theme quickly and make you website attractive.

erver'>
Login to add your contents and source code to this article
share this article :
post comment
 

Thank you. Simple but good tutorial<div><br></div><div><a href="http://www.xininvoice.com">invoice software</a></div>

Posted by keith chee Jan 31, 2011

really nice n simple, n i couldn't blv i've created my first theme enabled  website, thnx.....keep up the gr888 work....

pls post the code related to login control thnx in advance

Posted by kishan omar Nov 12, 2010

plz let me know how to change themes and skins dynamically and where i have to place the code after copying to wordpad.....................i have gone through what u have written...............

sen me at  himanshu.bharas@gmail.com

 

Posted by himanshu bharas Oct 13, 2010

hi diya send me sqlserve2005 to my email.

ankita.037@gmail.com

Posted by ankita gandhi Jul 09, 2010

you will get sqlserver with the visual studio 2005...


or you can download it from the internet..

Posted by Dipa Ahuja May 27, 2010
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor