title: asp.net textbox and dropdownlist loses value on postback
body: <p>i have a 4 textboxes on my webpage, one of which is populated using a javascript calender control...the problem is that all of these textboxes lose their value after a postback (clicking an asp.net button control). the textboxes are not readonly so i cant figure out why this is so...please help...and thanks</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              BindProdTopDetails();
              BindProdTable();
             // BindProdComment();
          }
  
  protected void BtnProdUpdate_Click(object sender, EventArgs e)
          {
              //saveProdDetails();
               bool success = saveProdDetails();
               if (success)
               {
                   string strScript96 = "&lt;script language=JavaScript&gt;";
                   strScript96 += "javascript:alert('Update Successful');";
                   strScript96 += "&lt;/script&gt;";
                   if (!ClientScript.IsStartupScriptRegistered("clientScript"))
                       ClientScript.RegisterClientScriptBlock(this.GetType(), clientScript", strScript96);
               }
          }
  
  public bool saveProdDetails()
          {
              string prodLine = DDProdLine.SelectedValue;
              string stock1 = DDMaterial.SelectedValue;
              string stock2 = TextBoxMaterial.Text.Trim().ToString();
              string supplier = TextBoxSupplier.Text.Trim().ToString();
              string billet = RBBillet.SelectedValue;
              string matTime1 = TextBoxMatTime.Text.Trim().ToString();
              string matTime2 = DDMatTime.SelectedValue;
              string prodTime1 = TextBoxProdTime.Text.Trim().ToString();
              string prodTime2 = DDProdTime.SelectedValue;
              string shipTime1 = TextBoxShipTime.Text.Trim().ToString();
              string shipTime2 = DDShipTime.SelectedValue;
  
              CultureInfo cultureInfo = CultureInfo.CurrentCulture;
              string format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern.ToString(); 
              string cmr = cmrDue.Value.ToString();
              string kc = kcDue.Value.ToString();
              string x = cmr.Substring(3, 2);
              string y = cmr.Substring(0, 2);
              string z = cmr.Substring(6, 4);
              string x1 = kc.Substring(3, 2);
              string y1 = kc.Substring(0, 2);
              string z1 = kc.Substring(6, 4);
              string finalCmr = x + "/" + y + "/" + z;
              string finalKC = x1 + "/" + y1 + "/" + z1;
  
              DateTime dt = DateTime.ParseExact(finalCmr, format, cultureInfo);
              DateTime cr = DateTime.ParseExact(finalKC, format, cultureInfo);
  
              string custDate = dt.ToString("dd/mm/yyyy");
              string kcDate = cr.ToString("dd/mm/yyyy"); 
              string id = Request.QueryString["id"];
              bool success = true;
  
              TextBoxProdComment1.Text = stock2 + "," + supplier + matTime1 + "," + prodTime1 + "," + shipTime1 + "," + custDate 
                  + "," + kcDate;
  
              try
              {
                   success = CRTopButtons.SaveProdTable(id, prodLine, stock1, supplier, billet, matTime1, matTime2, prodTime1,
                      prodTime2, shipTime1, shipTime2, custDate, kcDate);
              }
              catch (Exception e)
              {
                  System.Diagnostics.Trace.Write(e.StackTrace);
              }
  
              return success;
          }
  </code></pre>