protected void Button1_Click(object sender, EventArgs e)
 {
     if (HiddenField2.Value != "")
     {
         Button1.Text     = "Save";
         Al.brnd.brand    = TextBox1.Text.Trim().ToString();
         Al.brnd.brand_id = Convert.ToInt32(HiddenField1.Value);
         Al.BrandDelete();
         TextBox1.Text      = "";
         HiddenField1.Value = "";
         HiddenField2.Value = "";
         GridView1.DataBind();
     }
     else if (HiddenField1.Value != "")
     {
         Button1.Text     = "Save";
         Al.brnd.brand    = TextBox1.Text.Trim().ToString();
         Al.brnd.brand_id = Convert.ToInt32(HiddenField1.Value);
         Al.BrandEdit();
         HiddenField1.Value = "";
         GridView1.DataBind();
     }
     else
     {
         Al.brnd.brand = TextBox1.Text.Trim().ToString();
         Al.BrandInsert();
         GridView1.DataBind();
     }
 }