📄 webpartmanagerpanel.ascx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 WebPartManagerPanel : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
// Based on WebPartManager's capabilities, show / hide options for
// switching display modes of the page.
//
_browseViewLabel.Visible =
WebPartManager1.SupportedDisplayModes.Contains(WebPartManager.BrowseDisplayMode);
_catalogViewLabel.Visible =
WebPartManager1.SupportedDisplayModes.Contains(WebPartManager.CatalogDisplayMode);
_connectViewLabel.Visible =
WebPartManager1.SupportedDisplayModes.Contains(WebPartManager.ConnectDisplayMode);
_designViewLabel.Visible =
WebPartManager1.SupportedDisplayModes.Contains(WebPartManager.DesignDisplayMode);
_editViewLabel.Visible =
WebPartManager1.SupportedDisplayModes.Contains(WebPartManager.EditDisplayMode);
_personalizationModeToggleLabel.Visible =
WebPartManager1.Personalization.CanEnterSharedScope;
}
protected void cmdBrowseView_Click(object sender, EventArgs e)
{
WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
}
protected void cmdDesignView_Click(object sender, EventArgs e)
{
WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
}
protected void cmdEditView_Click(object sender, EventArgs e)
{
WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode;
}
protected void cmdConnectView_Click(object sender, EventArgs e)
{
WebPartManager1.DisplayMode = WebPartManager.ConnectDisplayMode;
}
protected void cmdCatalogView_Click(object sender, EventArgs e)
{
WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
}
protected void cmdPersonalizationModeToggle_Click(object sender, EventArgs e)
{
WebPartManager1.Personalization.ToggleScope();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -