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;
using System.Security.Permissions;
//using System.
[AspNetHostingPermission(SecurityAction.Demand,
Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand,
Level = AspNetHostingPermissionLevel.Minimal)]
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//WebPartManager wpm = new WebPartManager();
//Response.Write(wpm.SupportedDisplayModes.Count);
DropDownList1.Items.Add("select");
foreach (WebPartDisplayMode wpdm in WebPartManager1.SupportedDisplayModes)
{
String ModeName = wpdm.Name;
if (ModeName != null)
{
ListItem LI = new ListItem(ModeName, ModeName);
DropDownList1.Items.Add(LI);
}
}
Searching1.Title = "dipak";
}
if (Searching1.Title != null)
{
//WebPartZone2.WebParts[1].Title = Searching1.Title;
}
//WebPartZone1.WebParts[0].Title = "Hi";
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
//WebPartManager wpm=new WebPartManager();
String selectedMode = DropDownList1.SelectedValue;
WebPartDisplayMode mode =WebPartManager1.SupportedDisplayModes[selectedMode];
if (mode != null)
WebPartManager1.DisplayMode = mode;
}
}