asp.net.ph

DetailsView.DeleteItem Method

System.Web.UI.WebControls Namespace   DetailsView Class


.NET Framework version 2.0

Deletes the current record in the DetailsView control from the data source.

[ VB ]
Overridable Public Sub DeleteItem ( )

[ C# ]
public virtual void DeleteItem ( );

[ C++ ]
public: virtual void DeleteItem ( );

[ JScript ]
public function DeleteItem ( );

Remarks

Use the DeleteItem method to programmatically delete the current record in the DetailsView control from the data source.

This method is commonly used when you need to delete the current record from outside of the DetailsView control, such as from a different control on the page.

Calling this method also raises the ItemDeleted and ItemDeleting events.

Example

The following example demonstrates how to use the DeleteItem method to programmatically delete the current record in a DetailsView control from the data source.

<%@ Page language = "C#" %>

<script runat = "server">
   void DeleteButton_Click ( Object src, EventArgs e ) {
      EmployeeDetailsView.DeleteItem ( );
   }
</script>
  C# VB

See Also

DetailsView Members   InsertItem   UpdateItem Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph