<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Default Web Parts Page
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;
}
}
}