/
BehaviorEditorPart.xml
459 lines (379 loc) · 36.6 KB
/
BehaviorEditorPart.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<Type Name="BehaviorEditorPart" FullName="System.Web.UI.WebControls.WebParts.BehaviorEditorPart">
<TypeSignature Language="C#" Value="public sealed class BehaviorEditorPart : System.Web.UI.WebControls.WebParts.EditorPart" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit BehaviorEditorPart extends System.Web.UI.WebControls.WebParts.EditorPart" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.WebParts.BehaviorEditorPart" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class BehaviorEditorPart
Inherits EditorPart" />
<TypeSignature Language="F#" Value="type BehaviorEditorPart = class
 inherit EditorPart" />
<TypeSignature Language="C++ CLI" Value="public ref class BehaviorEditorPart sealed : System::Web::UI::WebControls::WebParts::EditorPart" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.WebControls.WebParts.EditorPart</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides an editor control that enables end users to edit several user interface (UI) properties on an associated <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class is an editor control that derives from the <xref:System.Web.UI.WebControls.WebParts.EditorPart> class, and is used to edit properties that affect the behavior of an associated <xref:System.Web.UI.WebControls.WebParts.WebPart> or <xref:System.Web.UI.WebControls.WebParts.GenericWebPart> control.
Just as there are tool-oriented zones in the Web Parts control set (for details, see the <xref:System.Web.UI.WebControls.WebParts.ToolZone> class overview), there are tool-oriented part controls (tool parts), and each tool part must reside in a certain type of tool zone. Tool parts in the Web Parts control set have two distinguishing characteristics:
- They are helper controls that enable end users to personalize controls on a Web Parts page.
- They are visible only in certain display modes.
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control is a tool part that becomes visible only when a Web Parts page is in edit mode, and when a specific <xref:System.Web.UI.WebControls.WebParts.WebPart> control has been selected for editing. The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, like all other <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls, resides in an <xref:System.Web.UI.WebControls.WebParts.EditorZone> control.
> [!IMPORTANT]
> An <xref:System.Web.UI.WebControls.WebParts.EditorZone> zone can contain only <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls, and <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls cannot be placed in any other type of zone.
The control is not displayed on the page under certain conditions. If the <xref:System.Web.UI.WebControls.WebParts.WebPart.IsShared%2A> property value on the <xref:System.Web.UI.WebControls.WebParts.WebPart> control being edited is `true`, and the page is in user personalization scope (which is the default), the control is not displayed. For the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control to be displayed in this scenario, typically you would need to follow two steps:
- Add an entry to the Web.config file that gives an authorized user permission to edit Web pages in shared personalization scope (which means that the changes the user makes will be visible to all users of the application).
- Programmatically change the page from user-level to shared-level personalization scope at run time, for example by using the <xref:System.Web.UI.WebControls.WebParts.WebPartPersonalization.ToggleScope%2A> method.
For an example of how to make the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control visible in a page, see the Example section of this topic. For more information about shared controls and personalization scope, see [Web Parts Personalization Overview](https://docs.microsoft.com/previous-versions/aspnet/z36h8be9(v=vs.100)).
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class also has an important method, <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges%2A>, which it inherits from the <xref:System.Web.UI.WebControls.WebParts.EditorPart> class and overrides. The method is critical because it enables getting the property values from the <xref:System.Web.UI.WebControls.WebParts.WebPart> control being edited and assigning them to the fields of the editing control.
In most cases, the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control should be used in page persistence format by declaring an `<asp:behavioreditorpart>` element inside a `<zonetemplate>` element, which is in turn contained by an `<asp:editorzone>` element on a Web page. The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control enables end users to edit the following UI properties of a <xref:System.Web.UI.WebControls.WebParts.WebPart> control:
- <xref:System.Web.UI.WebControls.WebParts.Part.Description%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.TitleUrl%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.TitleIconImageUrl%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.CatalogIconImageUrl%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.HelpUrl%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.HelpMode%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.ImportErrorMessage%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.ExportMode%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AuthorizationFilter%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowClose%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowConnect%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowEdit%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowHide%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowMinimize%2A>
- <xref:System.Web.UI.WebControls.WebParts.WebPart.AllowZoneChange%2A>
To edit other properties and behavior of <xref:System.Web.UI.WebControls.WebParts.WebPart> controls, you can use the other <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls supplied with the Web Parts control set. These controls include the <xref:System.Web.UI.WebControls.WebParts.LayoutEditorPart>, the <xref:System.Web.UI.WebControls.WebParts.AppearanceEditorPart>, and the <xref:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart> control. The supplied <xref:System.Web.UI.WebControls.WebParts.EditorPart> controls should provide most editing features required to edit <xref:System.Web.UI.WebControls.WebParts.WebPart> controls, but you can also create a custom editor control by inheriting from the <xref:System.Web.UI.WebControls.WebParts.EditorPart> class. For a code example, see the <xref:System.Web.UI.WebControls.WebParts.EditorPart> class overview.
> [!NOTE]
> To improve accessibility, the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control is rendered within a `<fieldset>` element. The `<fieldset>` element groups the related set of controls used for editing in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, and it facilitates tabbed navigation among those controls for both visual user agents (such as ordinary Web browsers) and speech-oriented user agents (such as screen-reading software).
## Accessibility
The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see [ASP.NET Controls and Accessibility](https://docs.microsoft.com/previous-versions/ms227996(v=vs.140)).
## Examples
The following code example demonstrates how to declare a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control on a Web page, and enable it to edit several UI properties of a <xref:System.Web.UI.WebControls.WebParts.WebPart> control. The code example has four parts:
- A user control that enables you to change display modes on a Web Parts page.
- A Web page that contains an <xref:System.Web.UI.WebControls.WebParts.EditorZone> control and a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, which is used to edit the behavior properties of a <xref:System.Web.UI.WebControls.BulletedList> control.
- An entry to make in the Web.config file to give an authorized user permission to edit the page in shared personalization scope.
- An explanation of how the example works when you load the page in a browser.
The first part of this code example is the user control that enables users to change display modes on a Web page. For details about display modes and a description of the source code in this control, see [Walkthrough: Changing Display Modes on a Web Parts Page](https://msdn.microsoft.com/library/24e42f74-82dc-4c13-8574-130398985fc0). The documentation for this user control explains how to call the <xref:System.Web.UI.WebControls.WebParts.WebPartPersonalization.ToggleScope%2A> method to switch the page into shared mode, which enables the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control to appear.
[!code-aspx-csharp[WebParts_BehaviorEditorPart_Overview#5](~/snippets/csharp/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/CS/DisplayModeMenuCS.ascx#5)]
[!code-aspx-vb[WebParts_BehaviorEditorPart_Overview#5](~/snippets/visualbasic/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/VB/DisplayModeMenuVB.ascx#5)]
The second part of the code example is the Web page. It contains a declarative reference to an <xref:System.Web.UI.WebControls.WebParts.EditorZone> control, with a child `<zonetemplate>` element that contains declarative references to a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control. Note that the page also contains a <xref:System.Web.UI.WebControls.BulletedList> control that is bound to the Pubs database; because this control resides in a <xref:System.Web.UI.WebControls.WebParts.WebPartZone>, it is able to function as a <xref:System.Web.UI.WebControls.WebParts.WebPart> control that can be edited by the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://docs.microsoft.com/previous-versions/aspnet/w1sw53ds(v=vs.100)).
[!code-aspx-csharp[WebParts_BehaviorEditorPart_Overview#1](~/snippets/csharp/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/CS/behavioreditorpartcs.aspx#1)]
[!code-aspx-vb[WebParts_BehaviorEditorPart_Overview#1](~/snippets/visualbasic/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/VB/behavioreditorpartvb.aspx#1)]
The third part of the example is an entry in the Web.config file. You must make an entry like the following in the `<webParts>` section of the file, to enable an authorized user or set of users to edit the Web page when it is in shared personalization scope. This entry is a critical step; otherwise, the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control will not be visible when you switch the page into edit mode.
`<webParts>`
`<personalization>`
`<authorization>`
`<allow users="User_account" roles="admin"`
`verbs="enterSharedScope"/>`
`</authorization>`
`</personalization>`
`</webParts>`
When you load the page in a browser, you can first select the **Shared** option on the **Display Mode** drop-down list control. Next, click the drop-down list itself, and select **Edit Mode** to switch the page into edit mode. You can click the verbs menu (the downward arrow) in the title bar of the **Author List WebPart** control, and click **Edit** to begin editing. When the editing UI is visible, you can see the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, and a button and text box positioned above it. If you make some changes in the editing UI and click the **Apply** button, you can use the **Display Mode** drop-down list control to return the page to browse mode and see the full effect of the editing changes.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.WebParts.AppearanceEditorPart" />
<altmember cref="T:System.Web.UI.WebControls.WebParts.LayoutEditorPart" />
<altmember cref="T:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/z36h8be9(v=vs.100)">Web Parts Personalization Overview</related>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BehaviorEditorPart ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 BehaviorEditorPart();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Creates a new instance of the class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.%23ctor%2A> constructor is a default; no constructor is declared in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class and hence no special tasks are carried out when a new instance of the class is created.
Normally you do not need to use the constructor, because you can add a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control to a page declaratively at design time. However, if you need to add a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control programmatically for some reason, you can use the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.%23ctor%2A> constructor.
]]></format>
</remarks>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
<Member MemberName="ApplyChanges">
<MemberSignature Language="C#" Value="public override bool ApplyChanges ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool ApplyChanges() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.ApplyChanges" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ApplyChanges () As Boolean" />
<MemberSignature Language="F#" Value="override this.ApplyChanges : unit -> bool" Usage="behaviorEditorPart.ApplyChanges " />
<MemberSignature Language="C++ CLI" Value="public:
 override bool ApplyChanges();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Saves the values from a <see cref="T:System.Web.UI.WebControls.WebParts.BehaviorEditorPart" /> control to the corresponding properties in the associated <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control.</summary>
<returns>
<see langword="true" /> if the action of saving values from the <see cref="T:System.Web.UI.WebControls.WebParts.BehaviorEditorPart" /> control to the <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control is successful; otherwise (if an error occurs), <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.ApplyChanges%2A> method is a critical method on a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control. The method's purpose is to save the values a user has set on a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control to the corresponding properties in the associated <xref:System.Web.UI.WebControls.WebParts.WebPart> control. The associated control is referenced in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control's inherited <xref:System.Web.UI.WebControls.WebParts.EditorPart.WebPartToEdit%2A> property.
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.ApplyChanges%2A> method attempts to set a number of user interface (UI)-related property values on the associated <xref:System.Web.UI.WebControls.WebParts.WebPart> control. For a list of the property values that are set in this method, see the Remarks in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class overview.
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.ApplyChanges%2A> method is called when the user clicks an OK verb or an apply verb in the editing UI.
]]></format>
</remarks>
<exception cref="T:System.Exception">An error occurred when trying to set the value for a property on the associated <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control.</exception>
<altmember cref="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.AppearanceEditorPart.ApplyChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.LayoutEditorPart.ApplyChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart.ApplyChanges" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
<Member MemberName="CreateChildControls">
<MemberSignature Language="C#" Value="protected internal override void CreateChildControls ();" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void CreateChildControls() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.CreateChildControls" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub CreateChildControls ()" />
<MemberSignature Language="F#" Value="override this.CreateChildControls : unit -> unit" Usage="behaviorEditorPart.CreateChildControls " />
<MemberSignature Language="C++ CLI" Value="protected public:
 override void CreateChildControls();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DefaultButton">
<MemberSignature Language="C#" Value="public override string DefaultButton { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DefaultButton" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.DefaultButton" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property DefaultButton As String" />
<MemberSignature Language="F#" Value="member this.DefaultButton : string with get, set" Usage="System.Web.UI.WebControls.WebParts.BehaviorEditorPart.DefaultButton" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::String ^ DefaultButton { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Web.UI.Themeable(false)]</AttributeName>
<AttributeName Language="F#">[<System.Web.UI.Themeable(false)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the ID of the default button on the control.</summary>
<value>A string that contains the ID of the default button.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.DefaultButton%2A> property overrides the base property to set several attributes on the property. The property cannot be used with themes, and it cannot be browsed with a design-time user interface (UI). The value of the property is retrieved from the base property value.
This property cannot be set by themes or style sheet themes. For more information, see <xref:System.Web.UI.ThemeableAttribute> and [ASP.NET Themes and Skins](https://docs.microsoft.com/previous-versions/aspnet/ykzx33wh(v=vs.100)).
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.WebParts.LayoutEditorPart.DefaultButton" />
<altmember cref="P:System.Web.UI.WebControls.WebParts.AppearanceEditorPart.DefaultButton" />
<altmember cref="P:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart.DefaultButton" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
<Member MemberName="Display">
<MemberSignature Language="C#" Value="public override bool Display { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Display" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Display" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Display As Boolean" />
<MemberSignature Language="F#" Value="member this.Display : bool" Usage="System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Display" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property bool Display { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether a control should be displayed when its associated <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control is in edit mode.</summary>
<value>A Boolean value that indicates whether the control should be displayed.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Display%2A> property returns a value of `true`, meaning that the control will be displayed, except in one case. If the <xref:System.Web.UI.WebControls.WebParts.WebPart.IsShared%2A> property value on the <xref:System.Web.UI.WebControls.WebParts.WebPart> control being edited is `true`, and the page is in user personalization scope (which is the default), the control is not displayed. For an explanation of the steps required, and a code example that shows how to cause the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control to be displayed for editing, see the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class overview and code example.
The Web Parts control set is designed with the assumption that shared controls--controls that are visible to all users--should be visible for editing only when a page is in shared personalization scope, meaning that the editing changes are visible to all users.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.WebParts.LayoutEditorPart.Display" />
<altmember cref="P:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart.Display" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
<Member MemberName="OnPreRender">
<MemberSignature Language="C#" Value="protected internal override void OnPreRender (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void OnPreRender(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.OnPreRender(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub OnPreRender (e As EventArgs)" />
<MemberSignature Language="F#" Value="override this.OnPreRender : EventArgs -> unit" Usage="behaviorEditorPart.OnPreRender e" />
<MemberSignature Language="C++ CLI" Value="protected public:
 override void OnPreRender(EventArgs ^ e);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RenderContents">
<MemberSignature Language="C#" Value="protected internal override void RenderContents (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void RenderContents(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.RenderContents(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub RenderContents (writer As HtmlTextWriter)" />
<MemberSignature Language="F#" Value="override this.RenderContents : System.Web.UI.HtmlTextWriter -> unit" Usage="behaviorEditorPart.RenderContents writer" />
<MemberSignature Language="C++ CLI" Value="protected public:
 override void RenderContents(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SyncChanges">
<MemberSignature Language="C#" Value="public override void SyncChanges ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void SyncChanges() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub SyncChanges ()" />
<MemberSignature Language="F#" Value="override this.SyncChanges : unit -> unit" Usage="behaviorEditorPart.SyncChanges " />
<MemberSignature Language="C++ CLI" Value="public:
 override void SyncChanges();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Retrieves the property values from a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control and assigns them to the associated <see cref="T:System.Web.UI.WebControls.WebParts.BehaviorEditorPart" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges%2A> method is a critical method on a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control. It implements the <xref:System.Web.UI.WebControls.WebParts.EditorPart.SyncChanges%2A> method from the base class, retrieves the current values from the associated <xref:System.Web.UI.WebControls.WebParts.WebPart> control, and updates the controls in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control with those values so a user can edit them.
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges%2A> method is called whenever the values in the associated <xref:System.Web.UI.WebControls.WebParts.WebPart> control might have changed. For a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, the <xref:System.Web.UI.WebControls.WebParts.EditorZoneBase> zone that contains the control calls the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.SyncChanges%2A> method, so that the values in the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control are always synchronized with the values in the associated <xref:System.Web.UI.WebControls.WebParts.WebPart> control.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.ApplyChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.AppearanceEditorPart.SyncChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.LayoutEditorPart.SyncChanges" />
<altmember cref="M:System.Web.UI.WebControls.WebParts.PropertyGridEditorPart.SyncChanges" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
<Member MemberName="Title">
<MemberSignature Language="C#" Value="public override string Title { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Title" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Title" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property Title As String" />
<MemberSignature Language="F#" Value="member this.Title : string with get, set" Usage="System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Title" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::String ^ Title { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a title for the editor control.</summary>
<value>A string that is used as the title of the control. The default value is a calculated control name supplied by the Web Parts control set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Title%2A> property value is displayed in the title bar of a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control when the control is visible in edit mode. When the control is declared in a page, you can set a value for the `Title` attribute. If you do not supply a value for the title, a culture-specific default value is used to describe the properties that this control allows users to edit.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Title%2A> property of a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control. For the full code required to run the example, see the Example section of the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> class overview.
The following code shows how to set the title on a <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control declaratively in a Web page.
[!code-aspx-csharp[WebParts_BehaviorEditorPart_Overview#2](~/snippets/csharp/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/CS/behavioreditorpartcs.aspx#2)]
[!code-aspx-vb[WebParts_BehaviorEditorPart_Overview#2](~/snippets/visualbasic/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/VB/behavioreditorpartvb.aspx#2)]
The next part of the code example shows how to set the value of the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart.Title%2A> property programmatically.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://docs.microsoft.com/previous-versions/aspnet/w1sw53ds(v=vs.100)).
[!code-csharp[WebParts_BehaviorEditorPart_Overview#3](~/snippets/csharp/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/CS/behavioreditorpartcs.aspx#3)]
[!code-vb[WebParts_BehaviorEditorPart_Overview#3](~/snippets/visualbasic/VS_Snippets_WebNet/WebParts_BehaviorEditorPart_Overview/VB/behavioreditorpartvb.aspx#3)]
When you load the page in a browser, you can select **Edit Mode** in the **Display Mode** drop-down list control to switch to edit mode. You can click the verbs menu (the downward arrow) in the title bar of the **Author List WebPart** control, and click **Edit** to begin editing. When the editing UI is visible, you can see the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control, and a button and text box positioned above it. Note that the title of the <xref:System.Web.UI.WebControls.WebParts.BehaviorEditorPart> control is the value assigned to it in the declarative markup of the Web page. If you enter some text in the text box next to the **Update EditorPart Title** button, and then click the button, the title for the control is updated.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.WebParts.Part.Title" />
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/e0s9t4ck(v=vs.100)">ASP.NET Web Parts Controls</related>
</Docs>
</Member>
</Members>
</Type>