Webpart ASP.Net

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>



    Default Web Parts Page


    
    

        
        
        Mode: 
            Browse
            Design
            Catalog
        
    

                    Padding="6">
            
            
            
            
                            BorderWidth="1px" ForeColor="Red" />
            
            
                
                
            

            
            
            
                            Font-Size="0.6em" />
            
        
          
                    Padding="6">
            
            
            
            
                            BorderWidth="1px" ForeColor="Red" />
            
            
            
            
                            Font-Size="0.6em" />
            
        
        
            
                
            

        
         
    


File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
    if (this.IsPostBack == false)
    {
      this.WebPartZone1.Visible = true;
      this.WebPartZone2.Visible = true;
    }
    }
  protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  {
    if (DropDownList1.SelectedValue.ToLower() == "browse")
    {
      WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
    }
    else if (DropDownList1.SelectedValue.ToLower()=="design" )
    {
      WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
    }
    else
    {
      WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
    }
  }
}