303 lines
23 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Type Name="FormViewUpdatedEventArgs" FullName="System.Web.UI.WebControls.FormViewUpdatedEventArgs">
<TypeSignature Language="C#" Value="public class FormViewUpdatedEventArgs : EventArgs" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="T:System.Web.UI.WebControls.FormView" /> control raises the <see cref="E:System.Web.UI.WebControls.FormView.ItemUpdated" /> event when an Update button (a button with its CommandName property set to "Update") within the control is clicked, but after the <see cref="T:System.Web.UI.WebControls.FormView" /> control updates the record. This allows you to provide an event-handling method that performs a custom routine, such as checking the results of an update operation, whenever this event occurs.</para>
<para>A <see cref="T:System.Web.UI.WebControls.FormViewUpdatedEventArgs" /> 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 update operation, use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.AffectedRows" /> property. Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Exception" /> property to determine whether any exceptions occurred. You can also indicate whether the exception was handled in the event-handling method by setting the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.ExceptionHandled" /> property. If you need to access the original key field values for the updated record, use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Keys" /> property. The original non-key field values can be accessed by using the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.OldValues" /> property. Updated values (which include updated key field values, if you allow the user to edit key fields) are accessed using the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.NewValues" /> property.</para>
<para>By default, the <see cref="T:System.Web.UI.WebControls.FormView" /> control returns to the mode specified by the <see cref="P:System.Web.UI.WebControls.FormView.DefaultMode" /> property after an update operation. When handling an exception that occurred during the update operation, you can keep the <see cref="T:System.Web.UI.WebControls.FormView" /> control in edit mode by setting the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.KeepInEditMode" /> property to true.</para>
<para>For more information about handling events, see <format type="text/html"><a href="01e4f1bc-e55e-413f-98c7-6588493e5f67">Consuming Events</a></format>.</para>
<para>For a list of initial property values for an instance of the <see cref="T:System.Web.UI.WebControls.FormViewUpdatedEventArgs" /> class, see the <see cref="M:System.Web.UI.WebControls.FormViewUpdatedEventArgs.#ctor(System.Int32,System.Exception)" /> constructor.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Provides data for the <see cref="E:System.Web.UI.WebControls.FormView.ItemUpdated" /> event.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FormViewUpdatedEventArgs (int affectedRows, Exception e);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="affectedRows" Type="System.Int32" />
<Parameter Name="e" Type="System.Exception" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use this constructor to initialize a new instance of the <see cref="T:System.Web.UI.WebControls.FormViewUpdatedEventArgs" /> class.</para>
<para>The following table shows initial property values for an instance of the <see cref="T:System.Web.UI.WebControls.FormViewUpdatedEventArgs" /> class.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Property</para>
</term>
<description>
<para>Initial Value</para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.AffectedRows" />
</para>
</term>
<description>
<para>The value of the <paramref name="affectedRows" /> parameter.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Exception" />
</para>
</term>
<description>
<para>The <see cref="T:System.Exception" /> object contained in the <paramref name="e" /> parameter.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.ExceptionHandled" />
</para>
</term>
<description>
<para>Initialized to false.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.KeepInEditMode" />
</para>
</term>
<description>
<para>Initialized to false.</para>
</description>
</item>
</list>
<block subset="none" type="note">
<para>This constructor is used primarily by control developers when raising events.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.FormViewUpdatedEventArgs" /> class.</para>
</summary>
<param name="affectedRows">
<attribution license="cc4" from="Microsoft" modified="false" />The number of rows affected by the update operation.</param>
<param name="e">
<attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Exception" /> that represents the exception raised when the update operation was performed. If no exception is raised, use null for this parameter.</param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="AffectedRows">
<MemberSignature Language="C#" Value="public int AffectedRows { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.AffectedRows" /> property to determine the number of records affected by the update operation. This property is commonly used to verify that the correct number of records was updated in the following situations:</para>
<list type="bullet">
<item>
<para>Verify that only a single record was updated. Sometimes an improperly written update statement can update multiple records.</para>
</item>
<item>
<para>Verify that a record was updated when an error occurs during the update operation that does not raise an exception.</para>
</item>
<item>
<para>Verify that a record was updated when a data source control that supports conflict detection (optimistic concurrency checking), such as the <see cref="T:System.Web.UI.WebControls.SqlDataSource" /> and <see cref="T:System.Web.UI.WebControls.ObjectDataSource" /> controls, has its <see cref="P:System.Web.UI.WebControls.SqlDataSource.ConflictDetection" /> property set to the ConflictOptions.CompareAllValues enumeration value. Under this setting, a record that has been modified by another user concurrently might not be updated.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the number of rows affected by the update operation.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Exception">
<MemberSignature Language="C#" Value="public Exception Exception { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Exception</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Exception" /> property to determine the exception (if any) that was raised during the update operation. If no exceptions were raised, this property returns null.</para>
<block subset="none" type="note">
<para>If an exception was raised and you decide to handle the exception in the event handler, be sure to set the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.ExceptionHandled" /> property to true; otherwise, the exception is thrown again by the <see cref="T:System.Web.UI.WebControls.FormView" /> control.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the exception (if any) that was raised during the update operation.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ExceptionHandled">
<MemberSignature Language="C#" Value="public bool ExceptionHandled { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When an exception is raised during the update operation, use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.ExceptionHandled" /> 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 thrown again by the <see cref="T:System.Web.UI.WebControls.FormView" /> control. If this property is set to false, the exception is thrown again. To determine which exception was raised, use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Exception" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value indicating whether an exception that was raised during the update operation was handled in the event handler.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="KeepInEditMode">
<MemberSignature Language="C#" Value="public bool KeepInEditMode { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>By default, the <see cref="T:System.Web.UI.WebControls.FormView" /> control returns to the mode specified by the <see cref="P:System.Web.UI.WebControls.FormView.DefaultMode" /> property after an update operation. Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.KeepInEditMode" /> property to specify whether the <see cref="T:System.Web.UI.WebControls.FormView" /> control should remain in edit mode. To keep the <see cref="T:System.Web.UI.WebControls.FormView" /> control in edit mode, set this property to true.</para>
<block subset="none" type="note">
<para>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 <see cref="T:System.Web.UI.WebControls.FormView" /> control needs to remain in edit mode by default, set the <see cref="P:System.Web.UI.WebControls.FormView.DefaultMode" /> property instead.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value indicating whether the <see cref="T:System.Web.UI.WebControls.FormView" /> control should remain in edit mode after an update operation.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Keys">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.IOrderedDictionary Keys { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Collections.Specialized.IOrderedDictionary</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Keys" /> property contains the original values of the key fields listed in the <see cref="P:System.Web.UI.WebControls.FormView.DataKeyNames" /> property of a <see cref="T:System.Web.UI.WebControls.FormView" /> control. Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Keys" /> property to access the values of the key field for an updated record. For example, you can use these values to keep a log of updated records.</para>
<block subset="none" type="note">
<para>If you allow the user to update the values of the key fields, the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.Keys" /> property contains the original key field values. The updated values are stored in the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.NewValues" /> property.</para>
</block>
<para>The <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.Keys" /> property returns an <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object that implements the <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> interface. The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object contains <see cref="T:System.Collections.DictionaryEntry" /> objects that represent the fields of the updated record. To access the field names, use the <see cref="P:System.Collections.Specialized.OrderedDictionary.Keys" /> property of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object. Similarly, you can access the field values by using the <see cref="P:System.Collections.Specialized.OrderedDictionary.Values" /> property.</para>
<block subset="none" type="note">
<para>As a shortcut, you can also use the indexer of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object to access the field values directly. Data source controls that rely on the field order (such as <see cref="T:System.Web.UI.WebControls.AccessDataSource" />) can access field values only by index.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a dictionary that contains the original key field name/value pairs for the updated record.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="NewValues">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.IOrderedDictionary NewValues { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Collections.Specialized.IOrderedDictionary</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.NewValues" /> property to access the new field values for the updated record. For example, you can use these values to keep a log of updated records.</para>
<block subset="none" type="note">
<para>If you allow the user to update the values of the key fields, the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.Keys" /> property contains the original key field values. The updated values are stored in the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.NewValues" /> property.</para>
</block>
<para>The <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.NewValues" /> property returns an <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object that implements the <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> interface. The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object contains <see cref="T:System.Collections.DictionaryEntry" /> objects that represent the fields of the updated record. To access the field names, use the <see cref="P:System.Collections.Specialized.OrderedDictionary.Keys" /> property of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object. Similarly, you can access the field values by using the <see cref="P:System.Collections.Specialized.OrderedDictionary.Values" /> property.</para>
<block subset="none" type="note">
<para>As a shortcut, you can also use the indexer of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object to access the field values directly. Data source controls that rely on the field order (such as <see cref="T:System.Web.UI.WebControls.AccessDataSource" />) can access field values only by index.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a dictionary that contains the new field name/value pairs for the updated record.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="OldValues">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.IOrderedDictionary OldValues { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Collections.Specialized.IOrderedDictionary</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.OldValues" /> property to access the original non-key field values for the updated record. For example, you can use these values to keep a log of updated records. A data source control that supports conflict detection (optimistic concurrency checking), such as the <see cref="T:System.Web.UI.WebControls.SqlDataSource" /> and <see cref="T:System.Web.UI.WebControls.ObjectDataSource" /> controls, with its <see cref="P:System.Web.UI.WebControls.SqlDataSource.ConflictDetection" /> property set to the ConflictOptions.CompareAllValues also compares these original values against the record in the database before an update operation is performed. If a record has been modified by another user concurrently, the record is not updated.</para>
<block subset="none" type="note">
<para>The <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.OldValues" /> property does not contain key fields. If you allow the user to update the values of the key fields, the original key field values are stored in the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.Keys" /> property. The updated values are stored in the <see cref="P:System.Web.UI.WebControls.FormViewUpdateEventArgs.NewValues" /> property.</para>
</block>
<para>The <see cref="P:System.Web.UI.WebControls.FormViewUpdatedEventArgs.NewValues" /> property returns an <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object that implements the <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> interface. The <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object contains <see cref="T:System.Collections.DictionaryEntry" /> objects that represent the fields of the updated record. To access the field names, use the <see cref="P:System.Collections.Specialized.OrderedDictionary.Keys" /> property of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object. Similarly, you can access the field values by using the <see cref="P:System.Collections.Specialized.OrderedDictionary.Values" /> property.</para>
<block subset="none" type="note">
<para>As a shortcut, you can also use the indexer of the <see cref="T:System.Collections.Specialized.OrderedDictionary" /> object to access the field values directly. Data source controls that rely on the field order (such as <see cref="T:System.Web.UI.WebControls.AccessDataSource" />) can access field values only by index.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a dictionary that contains the original non-key field name/value pairs for the updated record.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
</Members>
</Type>