title: ASP.NET MVC5 Razor Refresh modal dialog
body: <p>I'm tryin' to get actual time in modal dialog every time a user press the Order button. </p>
  
  <pre><code>&lt;a class="btn btn-primary" data-toggle="modal" data-target="#OrderModal"&gt;@MEDONET.Language.Doctor.Texts.Order&lt;/a&gt;
  </code></pre>
  
  <p>So every time he do this in the modal div OrderModal</p>
  
  <pre><code>&lt;div id="OrderModal" class="modal fade" role="dialog"&gt;
      @Html.Action("CreateOrderForm", Model.CreateOrderVM)
  &lt;/div&gt;
  </code></pre>
  
  <p>Which calls to CreateOrderForm action </p>
  
  <pre><code>public ActionResult CreateOrderForm(CreateOrderVM createOrderVM)
      {
          createOrderVM.Minute = DateTime.Now.Minute.ToString().PadLeft(2, '0');
          return View("CreateOrderForm", createOrderVM);
      }
  </code></pre>
  
  <p>So that action is actually running every time and calls CreateOrderForm.cshtml file </p>
  
  <pre><code>@{
  Layout = null;
  }
  @model MEDONET.Models.CreateOrderVM
  
  &lt;div class="modal-dialog modal-sm"&gt;
  &lt;!-- Modal content--&gt;
  &lt;div class="modal-content"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
          &lt;h4 class="modal-title text-center"&gt;Order To Line&lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          @using (Html.BeginForm("CreateOrder", "Doctors", FormMethod.Post))
          {
              @Html.AntiForgeryToken()
              @Html.HiddenFor(m =&gt; m.DoctorId)
              &lt;div class="row text-center"&gt;
                  &lt;p&gt;Date &amp; Time&lt;/p&gt;
                  @Html.Label("Year")
                  @Html.EditorFor(model =&gt; model.Year, new { htmlAttributes = new { @class = "form-control", @Value = DateTime.Now.Year } })&lt;br /&gt;
                  @Html.Label("Month")
                  @Html.EditorFor(model =&gt; model.Month, new { htmlAttributes = new { @class = "form-control", @Value = DateTime.Now.Month } })&lt;br /&gt;
                  @Html.Label("Day")
                  @Html.EditorFor(model =&gt; model.Day, new { htmlAttributes = new { @class = "form-control", @Value = DateTime.Now.Day } })&lt;br /&gt;
                  @Html.Label("Hour")
                  @Html.EditorFor(model =&gt; model.Hour, new { htmlAttributes = new { @class = "form-control", @Value = DateTime.Now.Hour } })&lt;br /&gt;
                  @Html.Label("Minute")
                  @Html.EditorFor(model =&gt; model.Minute, new { htmlAttributes = new { @class = "form-control" } })&lt;br /&gt;
                  @if (this.User.IsInRole("Registrator"))
                  {
                      @Html.EditorFor(model =&gt; model.PhoneNumber, new { htmlAttributes = new { @class = "form-control" } })&lt;br /&gt;
                  }
                  &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
          }
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>BUT! The popup fields are still filled with the first time given while parent page loading.</p>
  
  <p>How can I give a user new time every time he press the Order button?</p>