ToolBox WepParts Control EditorZone

EditorZone Web Server Control

in ASP.NET environment,This article describes you how to work with EditorZone Web Control.The goal of the EditorZone Web server control is that enable the end users to personalize Web pages and save their personalized settings. This control can serve as the primary control in the Web Parts control set for hosting EditorPart controls on a Web page.

These control includes editing the appearance, layout, behavior, and other properties of the visible WebPart controls. Several controls in the Web Parts control set provide the editing features, including the EditorZone control, which is the primary control in the Web Parts control set for hosting EditorPart controls on a Web page.

EditorPart controls

  • AppearanceEditorPart -Provides an interface that enables users to customize the visual properties of a WebPart control at run time, such as the width, height and title.
  • BehaviorEditorPart -Provides an interface that enables users to customize behavior properties of a WebPart control at run time, such as the display of the minimize, close, and edit buttons.
  • LayoutEditorPart -Provides an interface that enables users to customize layout properties of a WebPart control at run time, such as selecting between a minimized and normal state, or setting the index at which the control will appear within the target zone.
  • PropertyGridEditorPart -Provides an interface that enables users to edit custom properties at run time that are declared as part of a WebPart control.

An EditorZone control can visible in a page at run time when a Web Parts page enters edit mode, and it makes available various EditorPart controls that can be used to personalize WebPart controls.

the following code snippets demonstrates how to work with the EditorZone Control

in .aspx.cs page,

 void Button1_Click(object sender, EventArgs e)
  {
    if (ez1.ApplyVerb.Enabled == true)
      ez1.ApplyVerb.Enabled = false;
    else
      ez1.ApplyVerb.Enabled = true;
  }

  void Button2_Click(object sender, EventArgs e)
  {
    ez1.BorderWidth = 2;
    ez1.BorderColor = System.Drawing.Color.DarkBlue;
  }

  void Button3_Click(object sender, EventArgs e)
  {
    Label1.Text = "
"; foreach (EditorPart part in ez1.EditorParts) { Label1.Text += part.ID + "
"; } } void Button4_Click(object sender, EventArgs e) { ez1.InstructionText = "My custom instruction text."; }

in .aspx page,

<html  >
<head id="Head1" runat="server">
  <title>Examples</title>
</head>
<body>
  <form id="form2" runat="server">
    <asp:WebPartManager ID="wp1" runat="server" />
    <uc1:DisplayModeMenuCS runat="server" id="displaymodemenu1" />
    <asp:WebPartZone ID="WebPartZone1" runat="server">
      <ZoneTemplate>
        <asp:BulletedList 
          ID="BulletedList1" 
          Runat="server"
          DisplayMode="HyperLink" 
          Title="Favorite Links" >
          <asp:ListItem Value="http://www.gmail.com">
            Gmail
          </asp:ListItem>
        </asp:BulletedList>
        <asp:Calendar ID="Calendar1" Runat="server" 
          Title="My Calendar" />
      </ZoneTemplate>
    </asp:WebPartZone>
    <asp:EditorZone ID="ez1" runat="server" >
      <VerbStyle Font-Italic="true" />
      <EditUIStyle BackColor="lightgray" />
      <PartChromeStyle BorderWidth="1" />
      <LabelStyle Font-Bold="true" />
      <CancelVerb Text="Cancel Changes" />
      <ZoneTemplate>
        <asp:AppearanceEditorPart ID="AppearanceEditorPart1" 
          runat="server" />
        <asp:LayoutEditorPart ID="LayoutEditorPart1" 
          runat="server" />
      </ZoneTemplate>
    </asp:EditorZone>
    <hr />
    <asp:Button ID="Button1" runat="server" Width="200"
      Text="Enable or Disable Apply" OnClick="Button1_Click" />
    <br />
    <asp:Button ID="Button2" runat="server" Width="200"
      Text="Set Zone BorderColor" OnClick="Button2_Click" />
    <br />
    <asp:Button ID="Button3" runat="server" Width="200"
      Text="Display EditorPart Collection" OnClick="Button3_Click" />
    <asp:Label ID="Label1" runat="server" />
    <br />
    <asp:Button ID="Button4" runat="server" Width="200"
      Text="Set Instruction Text" OnClick="Button4_Click" /> 
  </form>
</body>
</html>                 
                    
 
Related Links

Posted by: Admin
Posted on: 9/17/2009 at 4:59 PM
Tags: , ,
Categories: Asp.net
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (14) | Post RSSRSS comment feed

Comments

Onlineatoz.net

Thursday, September 17, 2009 5:17 PM

trackback

ToolBox WepParts Control WebPartZone

ToolBox WepParts Control WebPartZone

aig insurance United States

Sunday, April 18, 2010 4:54 PM

aig insurance

Interesting read, thanks for helping keep me busy at work ;)

Rapidshare United States

Tuesday, April 27, 2010 10:58 PM

Rapidshare

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Svitlana.Net.Ua United States

Wednesday, June 16, 2010 5:39 AM

Svitlana.Net.Ua

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.

vibram fivefingers People's Republic of China

Friday, June 18, 2010 3:40 AM

vibram fivefingers

I really like this type of Shoes too, can you help me look at which one has higher price point?
http://vibramshoesonline.com

няня United States

Saturday, June 19, 2010 12:35 AM

няня

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.
http://svitlana.net.ua/staff/category/3/ гувернантка, http://svitlana.net.ua/staff/category/5/ повар, http://svitlana.net.ua/staff/category/6/ садовник, http://svitlana.net.ua/staff/category/10/ репетитор, http://svitlana.net.ua/staff/category/4 домработница, http://svitlana.net.ua/staff/category/8/ семейная пара, http://svitlana.net.ua/pages/2/ работа няней.

Лучшие проститутки United States

Thursday, June 24, 2010 9:12 AM

Лучшие проститутки

Наверное, это из-за климата у девочек просыпается такое дикое желание и появляется страсть в глазах. Стоит отметить, что ночные бабочки очень сильно уважают своих клиентов, и никогда не пререкаются с ними, хотя, конечно, южный темперамент иногда дает знать о себе, и не дай вам Бог разозлить одну из них, тогда вы увидите, какой гнев обрушиться на вас. Лучше этого не допускать, и не портить себе настроение и нервы, а просто хорошо провести время с одной из представительниц самой древней профессии.

Покер United States

Sunday, June 27, 2010 1:10 PM

Покер

I really got a kick out of your article. I don\'t really have much to say in reply, I only wanted to comment to reply with wonderful operate. good luck in 2010.

Магазин сантехники United States

Monday, July 05, 2010 9:21 AM

Магазин сантехники

Can you please provide more information on this subject? BTW your blog is great. Cheers.

проститутка Москвы United States

Thursday, July 08, 2010 5:42 PM

проститутка Москвы

Can you please provide more information on this subject? BTW your blog is great. Cheers.

Проститутки United States

Sunday, July 11, 2010 10:50 AM

Проститутки

You gave nice ideas here. I done a research on the issue and learnt most peoples will agree with your blog. Certainly, these practices are unfair; but they say that most of their rules are only to apply to people who overdraw.

Новинки сантехники United States

Monday, July 12, 2010 6:04 AM

Новинки сантехники

It\\\'s an intriguing approach. I commonly see minimalist judgments on the matter but yours it\'s written in a pretty special way. For sure, I will revisit your site for more info.

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading