System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Deletes the current record in the FormView control from the data source.
[ VB ]
Overridable Public Sub DeleteItem ( )
[ C# ]
public virtual void DeleteItem ( );
[ C++ ]
public: virtual void DeleteItem ( );
[ JScript ]
public function DeleteItem ( );
Use the DeleteItem method to programmatically delete the current record in the FormView control from the data source.
This method is commonly used when you need to delete the current record from outside of the FormView control, such as from a different control on the page.
Calling this method also raises the ItemDeleted and ItemDeleting events.
The following example demonstrates how to use the DeleteItem method to programmatically delete the current record in a FormView control from the data source.
<%@ Page language = "C#" %>
<script runat = "server">
void DeleteButton_Click ( Object src, EventArgs e ) {
EmployeeFormView.DeleteItem ( );
}
</script>
<%@ Page language = "VB" %>
<script runat = "server">
Sub DeleteButton_Click ( ByVal src As Object, ByVal e As EventArgs )
EmployeeFormView.DeleteItem ( )
End Sub
</script> |
|
C# |
VB |
FormView Members InsertItem UpdateItem