title: ASP Text Box Mode Date Time setting Current DateTime
body: <p>TextBox, Text mode set to DatetimeLocal</p>
  
  <pre><code> &lt;!--Date--&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"&gt;
                                  &lt;h4&gt;Date&lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"&gt;
                                  &lt;asp:TextBox ID="txtDate" runat="server" TextMode="DateTimeLocal"&gt;&lt;/asp:TextBox&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>Here is my page_load Handler, setting current date time in textbox </p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              if (!IsPostBack)
              {
                  if (Session["user"] != null)
                  {                    
                      txtDate.Text = DateTime.Now.ToString();
                  }
                  else
                      Response.Redirect("login.aspx");
              }
          }
  </code></pre>
  
  <p>Current datetime not showing in textbox. . . 
  <a href="https://i.stack.imgur.com/Fxuwb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fxuwb.png" alt="enter image description here"></a></p>