title: asp.net form does not retain the value on the field
body: <p>I have a form as such:</p>
  
  <pre><code>    &lt;%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true"
  Inherits="DataEntry_EntryForm1" EnableEventValidation="false" CodeBehind="Bio.aspx.cs" %&gt;
  
      &lt;%@ MasterType VirtualPath="~/site.master" %&gt;
  
      &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
      &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"&gt;
      &lt;/asp:Content&gt;
  
  
      &lt;asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server"&gt;
  
      &lt;asp:TableRow&gt;
          &lt;asp:TableCell  &gt;
          &lt;asp:Label ID="lblRoomNum" runat="server" Text="Room #"  Width="100px" &gt;&lt;/asp:Label&gt; 
         &lt;/asp:TableCell&gt;
        &lt;asp:TableCell HorizontalAlign="Left"&gt;
             &lt;asp:TextBox ID="txtRoomNum" runat="server" Width="100px"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage=" Room # is required." ForeColor="Red" ControlToValidate="txtRoomNum"&gt;&lt;/asp:RequiredFieldValidator&gt;
                    &lt;/asp:TableCell&gt;
  
        &lt;/asp:Table&gt;
  
          &lt;div style="width: 300px; margin: 20px 250px"&gt;
           &lt;asp:Button ID="txtSubmit" runat="server" Text="Submit" OnClick="txtSubmit_Click" /&gt;
         &lt;/div&gt;
  
       &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I am using the same form for creating a new record as well as updating it. When I create a new record, it works fine.
  When I try to update a record with data already filled in, the form does not retain that value. Instead, it retains the value that was there previously.</p>
  
  <p>Is there anything wrong that I am doing? </p>
  
  <p>Here is the codebehind code:</p>
  
  <pre><code>     protected void txtSubmit_Click(object sender, EventArgs e)
         {
  
            string s = txtRoomNum.Text;
  
        }
  </code></pre>
  
  <p>It shows the old value and not the updated code. </p>