Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (46 sloc) 4.41 KB
<Type Name="FormViewInsertedEventHandler" FullName="System.Web.UI.WebControls.FormViewInsertedEventHandler">
<TypeSignature Language="C#" Value="public delegate void FormViewInsertedEventHandler(object sender, FormViewInsertedEventArgs e);" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed FormViewInsertedEventHandler extends System.MulticastDelegate" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.FormViewInsertedEventHandler" />
<TypeSignature Language="VB.NET" Value="Public Delegate Sub FormViewInsertedEventHandler(sender As Object, e As FormViewInsertedEventArgs)" />
<TypeSignature Language="C++ CLI" Value="public delegate void FormViewInsertedEventHandler(System::Object ^ sender, FormViewInsertedEventArgs ^ e);" />
<TypeSignature Language="F#" Value="type FormViewInsertedEventHandler = delegate of obj * FormViewInsertedEventArgs -&gt; unit" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="sender" Type="System.Object" />
<Parameter Name="e" Type="System.Web.UI.WebControls.FormViewInsertedEventArgs" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Docs>
<param name="sender">The source of the event.</param>
<param name="e">A <see cref="T:System.Web.UI.WebControls.FormViewInsertedEventArgs" /> that contains the event data.</param>
<summary>Represents the method that handles the <see cref="E:System.Web.UI.WebControls.FormView.ItemInserted" /> event of a <see cref="T:System.Web.UI.WebControls.FormView" /> control.</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.
When you create a <xref:System.Web.UI.WebControls.FormViewInsertedEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following example demonstrates how to programmatically add a <xref:System.Web.UI.WebControls.FormViewInsertedEventHandler> delegate to the <xref:System.Web.UI.WebControls.FormView.ItemInserted> event of a <xref:System.Web.UI.WebControls.FormView> control.
[!code-aspx-csharp[FormViewInsertedEventHandler#1](~/samples/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventHandler/CS/formviewinsertedeventhandlercs.aspx#1)]
[!code-aspx-vb[FormViewInsertedEventHandler#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventHandler/VB/formviewinsertedeventhandlervb.aspx#1)]
The following example demonstrates how to declaratively add a <xref:System.Web.UI.WebControls.FormViewInsertedEventHandler> delegate to the <xref:System.Web.UI.WebControls.FormView.ItemInserted> event of a <xref:System.Web.UI.WebControls.FormView> control.
[!code-aspx-csharp[FormViewInsertedEventHandlerDeclarative#1](~/samples/snippets/csharp/VS_Snippets_WebNet/FormViewInsertedEventHandlerDeclarative/CS/formviewinsertedeventhandlerdeclarativecs.aspx#1)]
[!code-aspx-vb[FormViewInsertedEventHandlerDeclarative#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/FormViewInsertedEventHandlerDeclarative/VB/formviewinsertedeventhandlerdeclarativevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.FormView" />
<altmember cref="T:System.Web.UI.WebControls.FormViewInsertedEventArgs" />
<altmember cref="E:System.Web.UI.WebControls.FormView.ItemInserted" />
<altmember cref="M:System.Web.UI.WebControls.FormView.OnItemInserted(System.Web.UI.WebControls.FormViewInsertedEventArgs)" />
</Docs>
</Type>
You can’t perform that action at this time.