User1028962535 posted
Hello I trying to prevent my gridview from updating, when a textbox outside of the gridview is empty but it's not working. See code below, any ideas what I am doing wrong?
Sub CustomersGridView_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
Select Case e.CommandName
Case "Edit"
Case "Cancel"
Case "Update"
If TextBox1.Text = "" Then
CustomersGridView.UpdateRow(CustomersGridView.EditIndex, False)
Response.Write("<script type=""text/javascript"">alert(""Empty textbox cannot save"");</script")
Else
Response.Write("<script type=""text/javascript"">alert(""Data saved ."");</script")
CustomersGridView.UpdateRow(CustomersGridView.EditIndex, True)
End If
End Select
thanks
Dan