on deleting of row of datagrid a delete msg popup
Any one can help me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Blocked AccountPosted Oct 10, 2007, 7:41 AM
Use This code snippet.
protected
void GridView_RowDataBound(object sender, GridViewRowEventArgs e){
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton imageButton = (ImageButton)e.Row.FindControl("ImageButton1");
imageButton.Attributes.Add("onclick", "javascript:return " +"confirm('Are you sure you want to
delete this record. " +"')");
}
} protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
// write code for the deletion
}
}
protected void GridView_RowDeleting(object sender, GridViewDeleteEventArgs e){
}
Amit MPosted Oct 9, 2007, 8:48 AM
just add javascript function onclick of ur row deletion button.
like this: add this code in one javascript function
if(confirm("do you want to delete this row")) //this will open popup up message with two button ok/cancel if user cick ok then browser will do trip for deletion otherwise on cancel it will not make trip
{retunr true; }
else
{
return false;
}
Amit MPosted Oct 9, 2007, 8:47 AM
just add javascript function onclick of ur row deletion button.
like this
if(confirm("do you want to delete this row")) //this will open popup up message with two button ok/cancel if user cick ok then browser will do trip for deletion otherwise on cancel it will not make trip
{retunr true; }
else
{
return false;
}