title: Date validation result not show
body: <p>I have a question,I made a validation between two dates,let's just say the first is maturity date and the second is value date.The validation rule is maturity date minus by value date and the result is put on the terms field.here's the code on .aspx file.</p>
  
  <pre><code>            &lt;asp:Label ID="Label13" CssClass="col-xs-2" runat="server"&gt;Value Date : &lt;/asp:Label&gt;
                &lt;div class="col-xs-6 col-sm-3"&gt;
                      &lt;asp:TextBox CssClass="form-control" ID="uiTxtValDate" runat="server" OnTextChanged="uiTxtValDate_TextChanged" AutoPostBack="true"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="uiTxtValDate" runat="server" ErrorMessage="Please fill the value date field." SetFocusOnError="true" Display="none"&gt;&lt;/asp:RequiredFieldValidator&gt;
                  &lt;/div&gt;
  
  
                  &lt;asp:Label ID="Label17" CssClass="col-xs-2" runat="server"&gt;Maturity Date : &lt;/asp:Label&gt;
                  &lt;div class="col-xs-6 col-sm-3"&gt;
                      &lt;asp:TextBox CssClass="form-control" ID="uiMaturityDate" runat="server" OnTextChanged="uiMaturityDate_TextChanged" AutoPostBack="true"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:RequiredFieldValidator ControlToValidate="uiMaturityDate" runat="server" ErrorMessage="Please fill the maturity date field." SetFocusOnError="true" Display="none"&gt;&lt;/asp:RequiredFieldValidator&gt;
                  &lt;/div&gt;
  
  
                  &lt;asp:Label ID="Label19" CssClass="col-xs-2" runat="server"&gt;Terms : &lt;/asp:Label&gt;
                  &lt;div class="col-xs-6 col-sm-3"&gt;
                      &amp;nbsp;&lt;asp:Label ID="lblTerms"  runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>And here's the validation</p>
  
  <pre><code>protected void uiMaturityDate_TextChanged(object sender, EventArgs e)
      {
          try
          {
              HideError();
              if (!string.IsNullOrEmpty(uiMaturityDate.Text) &amp;&amp; !string.IsNullOrEmpty(uiTxtValDate.Text))
              {
                  if (DateTime.Parse(uiMaturityDate.Text) &lt; DateTime.Parse(uiTxtValDate.Text))
                  {
                      throw new ApplicationException("Maturity Date must be Greater Than Value Date");
                  }
                  else if (DateTime.Parse(uiMaturityDate.Text) &gt; DateTime.Parse(uiTxtValDate.Text))
                  {
                      TimeSpan difference = DateTime.Parse(uiMaturityDate.Text) - DateTime.Parse(uiTxtValDate.Text);
                      lblTerms.Text = (difference.Days + " days").ToString();
                  }
              }
              else if (!String.IsNullOrEmpty(uiMaturityDate.Text) &amp;&amp; (DateTime.Parse(uiMaturityDate.Text) - DateTime.Now).Days &lt; 0)
              {
                  btnAdd.Enabled = false;
                  btnUpdate.Enabled = false;
                  throw new ApplicationException("Maturity date must be greater than today");
              }
              else
              {
                  if (Session["STATUS"] == "ADD")
                  {
                      btnAdd.Enabled = true;
                  }
                  else if (Session["STATUS"] == "UPDATE")
                  {
                      btnUpdate.Enabled = true;
                  }
              }
          }
          catch (Exception ex)
          {
              ShowError(ex.Message);
          }
      }
  
      protected void uiTxtValDate_TextChanged(object sender, EventArgs e)
      {
          try
          {
              HideError();
              if (!string.IsNullOrEmpty(uiMaturityDate.Text) &amp;&amp; !string.IsNullOrEmpty(uiTxtValDate.Text))
              {
                  if (DateTime.Parse(uiMaturityDate.Text) &lt; DateTime.Parse(uiTxtValDate.Text))
                  {
                      throw new ApplicationException("Maturity Date must be Greater Than Value Date");
                  }
                  else if (DateTime.Parse(uiMaturityDate.Text) &gt; DateTime.Parse(uiTxtValDate.Text))
                  {
                      TimeSpan difference = DateTime.Parse(uiMaturityDate.Text) - DateTime.Parse(uiTxtValDate.Text);
                      lblTerms.Text = (difference.Days + " days").ToString();
                  }
              }
              else if (!String.IsNullOrEmpty(uiTxtValDate.Text) &amp;&amp; (DateTime.Parse(uiTxtValDate.Text) - DateTime.Now).Days &lt; 0)
              {
                  btnAdd.Enabled = false;
                  btnUpdate.Enabled = false;
                  throw new ApplicationException("Value date must be greater than today");
              }
              else
              {
                  if (Session["STATUS"] == "ADD")
                  {
                      btnAdd.Enabled = true;
                  }
                  else if (Session["STATUS"] == "UPDATE")
                  {
                      btnUpdate.Enabled = true;
                  }
              }
          }
          catch (Exception ex)
          {
              ShowError(ex.Message);
          }
      }
  </code></pre>
  
  <p>When I debug from vs 2010 it works,but when I run from publish project,the terms doesn't show up</p>