protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeleteRec") { city.CityId = int.Parse(e.CommandArgument.ToString()); city.DeleteCity(); lblMsg.Text = "Record Deleted.."; GridView1.DataSource = city.ShowAllCity(); GridView1.DataBind(); } else if (e.CommandName == "UpdateRec") { Response.Redirect("~/Admin/Update/frmUpdateCity.aspx?CityId=" + e.CommandArgument); } }