title: Object reference not set to an instance of an object #2
body: <p>I have got below error message:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>Code-behind:</p>
  
  <pre><code>public partial class Edit : System.Web.UI.Page
  {
      private TextBox updated_time;
  
      protected void Page_Load(object sender, EventArgs e)
      {
          updated_time = (TextBox)ABC_DV.FindControl("txt_updated_time");
          updated_time.Text = DateTime.Now.ToString();
      }
  }
  </code></pre>
  
  <p>how could i solve this ?</p>
  
  <p><strong>UPDATED</strong></p>
  
  <pre><code>&lt;asp:DetailsView ID="ABC_DV" runat="server" AutoGenerateRows="False"
          DefaultMode="Edit" DataKeyNames="TYPE_ID" DataSourceID="ABC_EDS"&gt;
          &lt;Fields&gt;
              &lt;asp:TemplateField HeaderText="Type Id" SortExpression="TYPE_ID"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txt_type_id" Width="200" runat="server" Text='&lt;%# Bind("TYPE_ID") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;InsertItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("TYPE_ID") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/InsertItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Bind("TYPE_ID") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;        
              &lt;asp:TemplateField HeaderText="Updated Time" SortExpression="UDPATED_TIME"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="txt_updated_time" Width="200" runat="server" Text='&lt;%# Bind("UDPATED_TIME") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;InsertItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox2" runat="server" Text='&lt;%# Bind("UDPATED_TIME") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/InsertItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Labe2" runat="server" Text='&lt;%# Bind("UDPATED_TIME") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;            
          &lt;/Fields&gt;
      &lt;/asp:DetailsView&gt;
  </code></pre>