if (e.Row.RowType == DataControlRowType.DataRow)
{
string EmployeeId = Session["EmployeeId"].ToString();
Button b = (Button)e.Row.FindControl("btnDelete");
if (user can delete the row)
{
b.Visible = true;
b.Attributes.Add("onclick", "javascript:return " +
"confirm('Are you sure you want to delete this record " +
DataBinder.Eval(e.Row.DataItem, "SequenceId")+ "')");
}
else
{
b.Visible = false;
}
}
Don't you need to check if the user can delete the item? I would only make it visible for those users who are authorized to delete it.