title: Page not redirecting, MVC
body: <p>I am currently working on a project in MVC and needed to pass data from the view to controller so I have done that using ajax, However upon button click (triggers value to be sent to controller) The page does not redirect to the next page(From reservation_step_1 to reservation_step_2), instead it does nothing, yet the value passes to the respective controller action(received by reservation_step_1 and sent to reservation_step_2).</p>
  
  <p>My controller actions:</p>
  
  <pre><code>    [HttpPost]
      [ValidateInput(false)]
      public ActionResult reservation_step_1(string x)
      {
          string val = x;
          return RedirectToAction("reservation_step_2", "Home", new { val = val });
      }
  
      [HttpGet]
      public ActionResult reservation_step_2(string val)
      {
          string rat = val;
          ViewBag.totda = rat;
          return View();
      }
  </code></pre>
  
  <p>My View:</p>
  
  <pre><code>&lt;body&gt;
      &lt;img src="~/images/maxresdefault.jpg" style="width:1457px; height:325px; margin-left: -160px;" /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;table class="table"&gt;
          @foreach (var item in Model)
          {
              {
              &lt;div class="tabcolumn-container" style="height: 90px; border: 1px solid grey"&gt;
  
                  &lt;div class="tabcolumn30 frame" style="margin-top: 0px; margin-bottom: 0px;"&gt;
                      &lt;div style="height: 35px; background-color: grey;"&gt;
                          &lt;p style="font-size: 22px; font-weight: bold"&gt;@item.group_category&lt;/p&gt;
                      &lt;/div&gt;
                      &lt;span class="helper"&gt;
  
                          &lt;img src="~/images/@item.image_path" /&gt;
  
                      &lt;/span&gt;
                  &lt;/div&gt;
                  &lt;div class="tabcolumn50"&gt;
  
                      &lt;div style="height: 40px; border-bottom: 1px solid grey; border-left: 1px solid grey; border-right: 1px solid grey"&gt;
                          &lt;p&gt;&amp;emsp;&amp;emsp;&amp;emsp;100kms per day&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.standard_100.00&lt;br /&gt;(per day)"/&gt;&amp;emsp;Standard Cover&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.super_100.00&lt;br /&gt;(per day)" /&gt;&amp;emsp;Upgrade to Super Cover&lt;/p&gt;
                      &lt;/div&gt;
  
                      &lt;div style="height: 40px; border-bottom: 1px solid grey; border-left: 1px solid grey; border-right: 1px solid grey"&gt;
                          &lt;p&gt;&amp;emsp;&amp;emsp;&amp;emsp;200kms per day&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.standard_200.00&lt;br /&gt;(per day)" /&gt;&amp;emsp;Standard Cover&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.super_200.00&lt;br /&gt;(per day)" /&gt;&amp;emsp;Upgrade to Super Cover&lt;/p&gt;
                      &lt;/div&gt;
  
                      &lt;div style="height: 40px; border-bottom: 1px solid grey; border-left: 1px solid grey; border-right: 1px solid grey"&gt;
                          &lt;p&gt;&amp;emsp;&amp;emsp;&amp;emsp;400kms per day&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.standard_400.00&lt;br /&gt;(per day)" /&gt;&amp;emsp;Standard Cover&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;&lt;input type="checkbox" class="slectOne" data-id="R @item.super_400.00&lt;br /&gt;(per day)" /&gt;&amp;emsp;Upgrade to Super Cover&lt;/p&gt;
                      &lt;/div&gt;
  
                      &lt;div style="height: 55px; display: table; border-left: 1px solid grey; background-color: grey; width: 569px; border-right: 1px solid grey"&gt;
  
                      &lt;/div&gt;
                      &lt;input type="hidden" value="" id="rate" name="crate"&gt;
                  &lt;/div&gt;
  
                  &lt;div class="tabcolumn20" style="height: 160px"&gt;
                      &lt;p style="font-size: 14px; text-align: center"&gt;Pick-up location: In Branch&lt;/p&gt;
                      &lt;p style="font-size: 14px; text-align: center"&gt;Fuel Policy: Full to Full&lt;/p&gt;
                      &lt;p id="currentRate" style="padding-left: 10px; padding-right: 10px; font-size: 18px; font-weight: bold; margin-top: 10px; text-align: center" class="result"&gt;Please choose cover to continue&lt;/p&gt;
  
                      &lt;input type="submit" onclick="getRate(); " value="Book Now!" style="height: 56px; background-color: yellow; width: 227.66px; border-style: none" /&gt;
  
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;br /&gt;
                  }
              }
      &lt;/table&gt;
  
      &lt;script&gt;
                          function getRate()
                          {
                              var cr = document.getElementById("currentRate").innerHTML;
                              var a = cr.substring(0, cr.length - 16);
                              var b = a.substring(2);
  
                              $.post("/Home/reservation_step_1  ", { x: b });
                          }
      &lt;/script&gt;
  
      &lt;script&gt;
                          $(document).ready(function () {
                              $('.slectOne').on('change', function () {
                                  $('.slectOne').not(this).prop('checked', false);
  
                                  let result = $('.result', $(this).closest('.tabcolumn-container'));
                                  result.html($(this).is(":checked") ? $(this).data("id") : '');
                              });
                          });
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>It does work with the help of HTML Helpers (using (Html.BeginForm("reservation_step_1", "Home", FormMethod.Post))) but then passing data using ajax and html helpers simultaneously loops through the action twice and causes the ajax values to turn to null.</p>
  
  <p>Any help on how i can keep the ajax values to pass to the respective controller and redirect to the respective view?</p>