- BehaviourEditorPart Web Server Control
in ASP.NET environment,This article describes you how to work with BehaviourEditorPart
Web Control.The mechanism of BehaviorEditorPart control is that provides an editor
control that allows the end users to edit properties.and that affect the behavior
of an associated WebPart or GenericWebPart control.
The following Properties of webpart control can be customized using BehaviourEditorPart
control
- HelpUrl -Specify the Help Link.
- TitleIconImageUrl -Setting the Title Icon Image link.
- Description -Specify the description text of the Web Part.
- CatalogIconImageUrl -Setting the Catalog Icon Image link.
- HelpMode -Specify the Help Mode.
- ExportMode -Select the Export Mode.
- AuthorizationFilter -Set the Authorization Filter.
- AllowClose -Specify whether a Web part can be removed from the page.
- AllowHide -Specify whether a Web part can be hidden.
- AllowMinimize -Specify whether a Web part can be minimized.
- TitleUrl -Specify the Title Link.
At the Following situations,The BehaviorEditorPart control is displayed on the page
- When provided an authorized user permission to edit Web pages in shared personalization
scope, which means that the user's changes are visible to all other users.
- Along the run time,change the page from user-level to shared-level personalization
programmatically .
At the Following situations,The BehaviorEditorPart control is not displayed on the
page
- When the IsShared property is set to true.
- The page is in user personalization scope
the following code snippets demonstrates how to work with the BehaviorEditorPart
Control
in .aspx.cs page,
-
protected void Page_Load(object sender, EventArgs e)
{
btn1.Visible = false;
txt1.Visible = false;
BulletedList1.DataBind();
}
protected void btn1_Click(object sender, EventArgs e)
{
BehaviorEditorPart1.Title = Server.HtmlEncode(txt1.Text);
}
protected void BehaviorEditorPart1_PreRender(object sender,
EventArgs e)
{
btn1.Visible = true;
txt1.Visible = true;
}
-
in .aspx page,
-
<%@ Register Src="~/displayModeMenuVB.ascx"
TagPrefix="uc1"
TagName="DisplayModeMenuVB" %>
<html >
<head id="Head1" runat="server">
</head>
<body>
<form id="form2" runat="server">
<asp:SqlDataSource ID="ds1" runat="server"
connectionString="<%$ ConnectionStrings:conn %>"
SelectCommand="Select * From Table1"/>
<asp:WebPartManager ID="wp1" runat="server" />
<uc1:DisplayModeMenuCS id="menu1" runat="server" />
<asp:WebPartZone ID="wz1" runat="server" Width="150"
style="z-index: 100; left: 10px; position: absolute; top: 90px" >
<ZoneTemplate>
<asp:Panel ID="panel1" runat="server" Title="Author List WebPart">
<asp:Label ID="Label1" runat="server"
Text="Author Names"
Font-Bold="true"
Font-Size="120%"/>
<asp:BulletedList ID="BulletedList1" runat="server"
DataSourceID="ds1"
DataTextField="au_lname"
DataValueField="au_id"/>
</asp:Panel>
</ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone ID="WebPartZone2" runat="server" Width="150"
style="z-index: 101; left: 170px; position: absolute; top: 90px" />
<asp:EditorZone ID="EditorZone1" runat="server"
style="z-index: 102; left: 340px; position: absolute; top: 90px"
Width="170px">
<ZoneTemplate>
<asp:BehaviorEditorPart ID="BehaviorEditorPart1" runat="server"
Title="My BehaviorEditorPart"
OnPreRender="BehaviorEditorPart1_PreRender" />
</ZoneTemplate>
</asp:EditorZone>
<asp:Button ID="btn1" runat="server" Width="140"
Text="Update EditorPart Title"
style="left: 340px; position: absolute; top: 65px; z-index: 103;"
OnClick="btn1_Click" />
<asp:TextBox ID="txt1" runat="server"
style="z-index: 105; left: 500px; position: absolute; top: 65px" />
</form>
</body>
</html>
-
- Related Links
-
1f34ffc6-3a85-4e97-9d3f-143002124339|0|.0