Pages

Saturday, November 27, 2010

RowDeleting(1)


---------------------------------------------------------------
1.
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
TableCell cell = GridView1.Rows[e.RowIndex].Cells[2];
if (cell.Text == "Chai")
{
e.Cancel = true;
// lblmsg.Text = "You cannot delete : Chai";
ClientScript.RegisterStartupScript(GetType(), "Message", "<SCRIPT LANGUAGE='javascript'>alert('You cannot delete this product.');</script>");
}
else
{
Response.Write(" Product Deleted"); // write here the code to delete the product.
}
}
###########################################









0 comments:

Post a Comment

 

CodeAddict.com | Copyright 2009 Tüm Haklar? Sakl?d?r | Free Blogger Templates by GoogleBoy Download Free Wordpress Templates. Unblock through unblock myspace proxy, Hillsongs by Guitar Song Chords