G
Guest
I want to show a confirm message before the gridview delete a record in the
event:
of deleting. I put the following code and it shows the message twice. why?
rotected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
String cskey = "OnSubmitScript";
String scriptText = "return confirm('Are you sure you want to
delete?')";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!(cs.IsOnSubmitStatementRegistered(cstype, cskey)))
{
cs.RegisterOnSubmitStatement(cstype, cskey, scriptText);
}
If the answer is cancel where do I put
e.Cancel = true;
in order to cancel the delete.
Thankyou
event:
of deleting. I put the following code and it shows the message twice. why?
rotected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
String cskey = "OnSubmitScript";
String scriptText = "return confirm('Are you sure you want to
delete?')";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!(cs.IsOnSubmitStatementRegistered(cstype, cskey)))
{
cs.RegisterOnSubmitStatement(cstype, cskey, scriptText);
}
If the answer is cancel where do I put
e.Cancel = true;
in order to cancel the delete.
Thankyou