title: Prevent duplicate record insertion on page refresh
body: <p>I search A lot.. but failed to implement.
  here is my code, how i prevent duplicate insertion on page refresh,, (how i use viewstate, or any other method.... resposnse.redirect is not a solution in this scenario).</p>
  
  <pre><code>protected void btn_save_click(object sender, EventArgs e)
      { 
              System.Data.DataTable dt_plotid = new System.Data.DataTable();
              dt_plotid = FghBAL.Admitting.GetMax_ByPlotID(txt_plot.Text);
              string plotid = dt_plotid.Rows[0]["ID"].ToString();
              if (FghBAL.Alotee.InserAllotee(txt_alotee_name.Text.ToUpper(), ddl_alotee_sw.SelectedValue.ToUpper(), txt_alotee_fname.Text.ToUpper(), alotee_cnic, txt_alotee_phone.Text, txt_alotee_cellno.Text, txt_alotee_address.Text, txt_alotee_email.Text, plotid))
              {
                  lbl_error_3.Visible = true;
                  lbl_error_3.Text = "Add Successfully";
                  txt_alotee_name.Enabled = false;
                  ddl_alotee_sw.Enabled = false;
                  txt_alotee_fname.Enabled = false;
                  txt_alotee_cnic_1.Enabled = false;
                  txt_alotee_cnic_2.Enabled = false;
                  txt_alotee_cnic_3.Enabled = false;
                  txt_alotee_phone.Enabled = false;
                  txt_alotee_cellno.Enabled = false;
                  txt_alotee_address.Enabled = false;
                  txt_alotee_email.Enabled = false;
                  System.Data.DataTable dt_alotee_data = new System.Data.DataTable();
                  dt_alotee_data = FghBAL.Alotee.GetDatabyPlot_Id(plotid);
                  grid_alotee.DataSource = dt_alotee_data;
                  grid_alotee.DataBind();
                  grid_alotee.Visible = true;
                  btn_save_alotee.Visible = true;
  
                  btn_link_another_alotee.Visible = true;
                  lbl_grd_alotee.Visible = true;
                  tabcontent3.Style.Add("height", "80%");
                  //ViewState["dt_alotee_view"] = dt_alotee_data;
                  btn_save_alotee.Enabled = false;
                 // Response.Redirect(Request.Url.AbsoluteUri);
              }
              else
              {
                  lbl_error_3.Text = "Unable to add Allottee Information";
              }
          }
  </code></pre>