-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
FormViewInsertedEventArgs.xml
373 lines (320 loc) · 28 KB
/
FormViewInsertedEventArgs.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
<Type Name="FormViewInsertedEventArgs" FullName="System.Web.UI.WebControls.FormViewInsertedEventArgs">
<TypeSignature Language="C#" Value="public class FormViewInsertedEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FormViewInsertedEventArgs extends System.EventArgs" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.FormViewInsertedEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class FormViewInsertedEventArgs
Inherits EventArgs" />
<TypeSignature Language="F#" Value="type FormViewInsertedEventArgs = class
 inherit EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class FormViewInsertedEventArgs : EventArgs" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides data for the <see cref="E:System.Web.UI.WebControls.FormView.ItemInserted" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.FormView> control raises the <xref:System.Web.UI.WebControls.FormView.ItemInserted> event when an Insert button (a button with its `CommandName` property set to "Insert") within the control is clicked, but after the <xref:System.Web.UI.WebControls.FormView> control inserts the record. This allows you to provide an event-handling method that performs a custom routine, such as checking the results of an insert operation, whenever this event occurs.
A <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs> object is passed to the event-handling method, which allows you to determine the number of records affected and any exceptions that might have occurred. To determine the number of records affected by the insert operation, use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows%2A> property. Use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception%2A> property to determine whether any exceptions occurred. You can also indicate whether the exception was handled in the event-handling method by setting the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled%2A> property. If you need to access the values of the inserted record, use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values%2A> property.
By default, the <xref:System.Web.UI.WebControls.FormView> control returns to the mode specified by the <xref:System.Web.UI.WebControls.FormView.DefaultMode%2A> property after an insert operation. If an exception occurs during the insert operation, you can keep the <xref:System.Web.UI.WebControls.FormView> control in insert mode by setting the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode%2A> property to `true`.
For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/).
For a list of initial property values for an instance of the <xref:System.Web.UI.WebControls.FormViewDeletedEventArgs> class, see the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.%23ctor%2A> constructor.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs> object passed to the event-handling method for the <xref:System.Web.UI.WebControls.FormView.ItemInserted> event to determine whether an exception occurred during an insert operation.
> [!IMPORTANT]
> This example contains 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://learn.microsoft.com/previous-versions/aspnet/w1sw53ds(v=vs.100)).
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgs/CS/formviewinsertedeventargscs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgs/VB/formviewinsertedeventargsvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FormViewInsertedEventArgs (int affectedRows, Exception e);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 affectedRows, class System.Exception e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.FormViewInsertedEventArgs.#ctor(System.Int32,System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (affectedRows As Integer, e As Exception)" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.FormViewInsertedEventArgs : int * Exception -> System.Web.UI.WebControls.FormViewInsertedEventArgs" Usage="new System.Web.UI.WebControls.FormViewInsertedEventArgs (affectedRows, e)" />
<MemberSignature Language="C++ CLI" Value="public:
 FormViewInsertedEventArgs(int affectedRows, Exception ^ e);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="affectedRows" Type="System.Int32" />
<Parameter Name="e" Type="System.Exception" />
</Parameters>
<Docs>
<param name="affectedRows">The number of rows affected by the insert operation.</param>
<param name="e">An <see cref="T:System.Exception" /> that represents the exception raised when the insert operation was performed. If no exception was raised, use <see langword="null" /> for this parameter.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.FormViewInsertedEventArgs" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs> class.
The following table shows the initial property values for an instance of <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows%2A>|The value of the `affectedRows` parameter.|
|<xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception%2A>|The <xref:System.Exception?displayProperty=nameWithType> object contained in the `e` parameter.|
|<xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled%2A>|Initialized to `false`.|
|<xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode%2A>|Initialized to `false`.|
> [!NOTE]
> This constructor is used primarily by control developers when raising events.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode" />
</Docs>
</Member>
<Member MemberName="AffectedRows">
<MemberSignature Language="C#" Value="public int AffectedRows { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 AffectedRows" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property AffectedRows As Integer" />
<MemberSignature Language="F#" Value="member this.AffectedRows : int" Usage="System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<MemberSignature Language="C++ CLI" Value="public:
 property int AffectedRows { int get(); };" />
<MemberType>Property</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#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the number of rows affected by the insert operation.</summary>
<value>The number of rows affected by the insert operation.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows%2A> property to determine the number of records affected by the insert operation. This property is commonly used to verify that the correct number of records was inserted in the following situations:
- Verify that only a single record was inserted. Sometimes an improperly written insert statement can insert multiple records.
- Verify that a record was inserted when an error occurs during the insert operation that does not raise an exception.
- Verify that a record was inserted when a data source control that supports conflict detection (optimistic concurrency), such as the <xref:System.Web.UI.WebControls.SqlDataSource> and <xref:System.Web.UI.WebControls.ObjectDataSource> controls, has its <xref:System.Web.UI.WebControls.SqlDataSource.ConflictDetection%2A> property set to the `ConflictOptions.CompareAllValues` enumeration value. Under this setting, a record that has the same key value as a record by another user concurrently might not be inserted.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows%2A> property to verify that a record was inserted during the insert operation.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgs/CS/formviewinsertedeventargscs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgs/VB/formviewinsertedeventargsvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
</Docs>
</Member>
<Member MemberName="Exception">
<MemberSignature Language="C#" Value="public Exception Exception { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Exception Exception" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Exception As Exception" />
<MemberSignature Language="F#" Value="member this.Exception : Exception" Usage="System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<MemberSignature Language="C++ CLI" Value="public:
 property Exception ^ Exception { Exception ^ get(); };" />
<MemberType>Property</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#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Exception</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the exception (if any) that was raised during the insert operation.</summary>
<value>An <see cref="T:System.Exception" /> that represents the exception that was raised during the insert operation.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception%2A> property to determine the exception (if any) that was raised during the insert operation. If no exceptions were raised, this property returns `null`.
> [!NOTE]
> If an exception was raised and you decide to handle the exception in the event handler, be sure to set the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled%2A> property to `true`; otherwise, the <xref:System.Web.UI.WebControls.FormView> control re-throws the exception.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception%2A> property to determine whether an exception was raised during an insert operation.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgs/CS/formviewinsertedeventargscs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgs/VB/formviewinsertedeventargsvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
</Docs>
</Member>
<Member MemberName="ExceptionHandled">
<MemberSignature Language="C#" Value="public bool ExceptionHandled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ExceptionHandled" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<MemberSignature Language="VB.NET" Value="Public Property ExceptionHandled As Boolean" />
<MemberSignature Language="F#" Value="member this.ExceptionHandled : bool with get, set" Usage="System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool ExceptionHandled { bool get(); void set(bool value); };" />
<MemberType>Property</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#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether an exception that was raised during the insert operation was handled in the event handler.</summary>
<value>
<see langword="true" /> if the exception was handled in the event handler; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When an exception is raised during the insert operation, use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled%2A> property to indicate whether the exception was handled in the event handler. When this property is set to `true`, the exception is considered handled and is not re-thrown. If this property is set to `false`, the <xref:System.Web.UI.WebControls.FormView> control re-throws the exception. To determine which exception was raised, use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception%2A> property.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.ExceptionHandled%2A> property to indicate that the exception was handled in the event handler.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgs/CS/formviewinsertedeventargscs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgs/VB/formviewinsertedeventargsvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.AffectedRows" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Exception" />
<altmember cref="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
</Docs>
</Member>
<Member MemberName="KeepInInsertMode">
<MemberSignature Language="C#" Value="public bool KeepInInsertMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool KeepInInsertMode" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode" />
<MemberSignature Language="VB.NET" Value="Public Property KeepInInsertMode As Boolean" />
<MemberSignature Language="F#" Value="member this.KeepInInsertMode : bool with get, set" Usage="System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool KeepInInsertMode { bool get(); void set(bool value); };" />
<MemberType>Property</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#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the <see cref="T:System.Web.UI.WebControls.FormView" /> control should remain in insert mode after an insert operation.</summary>
<value>
<see langword="true" /> to remain in insert mode after an insert operation; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, the <xref:System.Web.UI.WebControls.FormView> control returns to the mode specified by the <xref:System.Web.UI.WebControls.FormView.DefaultMode%2A> property. Use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode%2A> property to specify whether the <xref:System.Web.UI.WebControls.FormView> control should remain in insert mode after an insert operation. To keep the <xref:System.Web.UI.WebControls.FormView> control in insert mode, set this property to `true`.
> [!NOTE]
> This property should be used only when a situation occurs (such as an exception being raised) that requires the control to behave differently than it normally would. If the <xref:System.Web.UI.WebControls.FormView> control needs to remain in insert mode by default, set the <xref:System.Web.UI.WebControls.FormView.DefaultMode%2A> property instead.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.KeepInInsertMode%2A> property to keep the <xref:System.Web.UI.WebControls.FormView> control in insert mode when an exception occurs during an insert operation.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgs/CS/formviewinsertedeventargscs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgs/VB/formviewinsertedeventargsvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="P:System.Web.UI.WebControls.FormView.DefaultMode" />
</Docs>
</Member>
<Member MemberName="Values">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.IOrderedDictionary Values { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.IOrderedDictionary Values" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Values As IOrderedDictionary" />
<MemberSignature Language="F#" Value="member this.Values : System.Collections.Specialized.IOrderedDictionary" Usage="System.Web.UI.WebControls.FormViewInsertedEventArgs.Values" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Collections::Specialized::IOrderedDictionary ^ Values { System::Collections::Specialized::IOrderedDictionary ^ 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.Collections.Specialized.IOrderedDictionary</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a dictionary that contains the field name/value pairs for the inserted record.</summary>
<value>An <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> object that contains a dictionary of key field name/value pairs for the inserted record.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values%2A> property to access the values of the fields for the inserted record. For example, you can use these values to keep a log of inserted records.
The <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values%2A> property returns an <xref:System.Collections.Specialized.OrderedDictionary> object that implements the <xref:System.Collections.Specialized.IOrderedDictionary?displayProperty=nameWithType> interface. The <xref:System.Collections.Specialized.OrderedDictionary> object contains <xref:System.Collections.DictionaryEntry?displayProperty=nameWithType> objects that represent the fields of the inserted record. To access the field names, use the <xref:System.Collections.Specialized.OrderedDictionary.Keys%2A> property of the <xref:System.Collections.Specialized.OrderedDictionary> object. Similarly, you can access the field values by using the <xref:System.Collections.Specialized.OrderedDictionary.Values%2A> property.
> [!NOTE]
> As a shortcut, you can also use the indexer of the <xref:System.Collections.Specialized.OrderedDictionary> object to access the field values directly. The advantage in using the indexer is that it returns field values directly. Data source controls that rely on the field order (such as <xref:System.Web.UI.WebControls.AccessDataSource>) can access field values only by index.
## Examples
The following example demonstrates how to iterate through the items in the <xref:System.Web.UI.WebControls.FormViewInsertedEventArgs.Values%2A> collection.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventArgsValues/CS/formviewinsertedeventargsvaluescs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventArgsValues/VB/formviewinsertedeventargsvaluesvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<altmember cref="T:System.Collections.Specialized.IOrderedDictionary" />
<altmember cref="T:System.Collections.Specialized.OrderedDictionary" />
<altmember cref="T:System.Collections.DictionaryEntry" />
<altmember cref="P:System.Collections.Specialized.OrderedDictionary.Keys" />
<altmember cref="P:System.Collections.Specialized.OrderedDictionary.Values" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
</Docs>
</Member>
</Members>
</Type>