Imports System
Imports System.Data
Class EditFormVB
    Inherits Page

    Protected Sub DetailsView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles DetailsView1.ItemCommand
        If (e.CommandName = "Update") Then
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "mykey", "CloseAndRebind();", True)
        Else
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "mykey", "CancelEdit();", True)
        End If

    End Sub
End Class