title: Textbox loses value after postback (ASP - C#)
body: <p>I've been having a tough time with updating my text boxes and could really use some help. So basically, I have a popup panel for the user to select a value that I then populate into a certain text box.</p>
  
  <p>I am certain that the problem is either very simple to solve, or that I'm confused on what post back actually does. Here is a snippit of my code below:</p>
  
  <pre><code>    protected void grvSearchRecords_RowCommand(object sender, GridViewCommandEventArgs e)
      {
          if (string.Compare(e.CommandName, "EditRow", true) == 0)
          {
              long nMagic2Value = Convert.ToInt64(e.CommandArgument);
              string tmp = GetItem(nMagic2Value, currentTableName);
              textBox1.Text = tmp;
              Debug.WriteLine(textBox1.Text.ToString());
              ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "SearchRecords", "$(document).ready(function(){ $('#mask, #divSearchRecordsGrid').fadeOut(\"fast\"); });", true);
          }
      }
  </code></pre>
  
  <p>The "tmp" variable grabs the value I need and assigns it to the text box.</p>
  
  <p>I then run a Debug statement and confirm that the value is correctly assigned to the box. As soon as the function ends, however, that assigned value is lost, and the text box never populates with the new value.</p>