title: after submit redirect to the same page
body: <p>I am using smoothscroll navigation, like this:</p>
  
  <pre><code> &lt;li&gt;&lt;a href="#home" class="smoothScroll"&gt;HOME&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>And I have a contact form, like this:</p>
  
  <pre><code>&lt;section id="contact" class="text-center"&gt;
  
  
  
  
      @using (Html.BeginForm("contact","Home", FormMethod.Post, new { @enctype = "multipart/form-data" }))
      {
          @Html.AntiForgeryToken()
  
          &lt;section id="contact" class="text-center"&gt;
              &lt;div class="container"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-12 wow fadeInDown" data-wow-delay="2000"&gt;
                          &lt;h3&gt;CONTACT Microrout.nl&lt;/h3&gt;
                      &lt;/div&gt;
                      &lt;div class="col-md-2"&gt;&lt;/div&gt;
                      &lt;div class="col-md-8"&gt;
  
                          Microrout.nl
                          &lt;br /&gt;frederik hendriklaan 253-b
                          &lt;br /&gt;Den Haag
                          &lt;br /&gt;0641697144
  
  
                      &lt;/div&gt;
                      &lt;div class="col-md-2"&gt;&lt;/div&gt;
                      &lt;hr /&gt;
                      &lt;div class="form-group"&gt;
                          @Html.LabelFor(m =&gt; m.FromName, new { @class = "col-md-3" })
                          &lt;div class="col-md-10"&gt;
                              @Html.TextBoxFor(m =&gt; m.FromName, new { @class = "form-control" })
                              @Html.ValidationMessageFor(m =&gt; m.FromName)
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          @Html.LabelFor(m =&gt; m.FromEmail, new { @class = "col-md-3 control-label" })
                          &lt;div class="col-md-10"&gt;
                              @Html.TextBoxFor(m =&gt; m.FromEmail, new { @class = "form-control" })
                              @Html.ValidationMessageFor(m =&gt; m.FromEmail)
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          @Html.LabelFor(m =&gt; m.Message, new { @class = "col-md-3 control-label" })
                          &lt;div class="col-md-10"&gt;
                              @Html.TextAreaFor(m =&gt; m.Message, new { @class = "form-control" })
                              @Html.ValidationMessageFor(m =&gt; m.Message)
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;input type="submit" value="SHOOT MESSAGE" class="form-control"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              @*&lt;div class="google_map"&gt;
                      &lt;div id="map-canvas"&gt;&lt;/div&gt;
                  &lt;/div&gt;*@
  
  
          &lt;/section&gt;
      }
  
  
  
  
  
  
  &lt;/section&gt;
  </code></pre>
  
  <p>and this are the Contact methods:</p>
  
  <pre><code>public ActionResult Contact()
          {
              ViewBag.Message = "Your contact page.";
  
              return View();
          }
  
          [HttpPost]
          [ValidateAntiForgeryToken]
          public async Task&lt;ActionResult&gt; Contact(EmailFormModel model)
          {
              string message2 = "There are a few errors";
              if (ModelState.IsValid)
              {
                  try
                  {
  
  
                      message2 = "Thanks! We'll get back to you soon.";
                      var body = "&lt;p&gt;Email From: {0} ({1})&lt;/p&gt;&lt;p&gt;Message:&lt;/p&gt;&lt;p&gt;{2}&lt;/p&gt;";
                      var message = new MailMessage();
                      message.To.Add(new MailAddress("nengelen@online.nl")); //replace with valid value
                      message.Subject = "Your email subject";
                      message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message);
                      message.IsBodyHtml = true;
  
                      using (var smtp = new SmtpClient())
                      {
                          await smtp.SendMailAsync(message);
  
                      }
  
  
  
                  }
                  catch (Exception error)
                  {
                      Response.Write("Error sending email: " + error.Message + "&lt;br /&gt; StackTrace: " + error.StackTrace);
                  }
                  ViewBag.Message = "Thank you for contact us";
                  //return new RedirectToActionAnchor("Contact", "", "#contact");
  
              }
  
              //if (Request.IsAjaxRequest())
              //{
              //    return new JsonResult { Data = new { success = true, message = message2 } };
              //}
  
              //TempData["Message"] = message2;
  
  
              return View(model);
          }
  </code></pre>
  
  <p>But how to return back to the contact form, after submit, because after the submit the url changed to:</p>
  
  <pre><code>http://localhost:53534/Home/contact
  </code></pre>
  
  <p>Thank you</p>
  
  <p>I have it now like this:</p>
  
  <pre><code>[HttpPost]
          [ValidateAntiForgeryToken]
          public async Task&lt;ActionResult&gt; Contact(EmailFormModel model)
          {
              string message2 = "There are a few errors";
              if (ModelState.IsValid)
              {
                  try
                  {
  
  
                      message2 = "Thanks! We'll get back to you soon.";
                      var body = "&lt;p&gt;Email From: {0} ({1})&lt;/p&gt;&lt;p&gt;Message:&lt;/p&gt;&lt;p&gt;{2}&lt;/p&gt;";
                      var message = new MailMessage();
                      message.To.Add(new MailAddress("nengelen@online.nl")); //replace with valid value
                      message.Subject = "Your email subject";
                      message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message);
                      message.IsBodyHtml = true;
  
                      using (var smtp = new SmtpClient())
                      {
                          await smtp.SendMailAsync(message);
  
                      }
  
  
  
                  }
                  catch (Exception error)
                  {
                      Response.Write("Error sending email: " + error.Message + "&lt;br /&gt; StackTrace: " + error.StackTrace);
                  }
                  ViewBag.Message = "Thank you for contact us";
                  //return new RedirectToActionAnchor("Contact", "", "#contact");
  
              }
  
              //if (Request.IsAjaxRequest())
              //{
              //    return new JsonResult { Data = new { success = true, message = message2 } };
              //}
  
              //TempData["Message"] = message2;
  
  
              return View("Contact",model);
          }
  </code></pre>
  
  <p>but the problem is that it then goes to: <code>http://localhost:53534/Home/contact</code></p>
  
  <p>But the Url of Contact is:<code>http://localhost:53534/#contact</code></p>
  
  <p>And this is my navigation:</p>
  
  <pre><code>&lt;div class="collapse navbar-collapse"&gt;
                          &lt;ul class="nav navbar-nav navbar-right"&gt;
                              &lt;li&gt;&lt;a href="#home" class="smoothScroll"&gt;HOME&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#about" class="smoothScroll"&gt;STUDIO&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#team" class="smoothScroll"&gt;TEAM&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#service" class="smoothScroll"&gt;SERVICES&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#work" class="smoothScroll"&gt;WORK&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#pricing" class="smoothScroll"&gt;PRICING&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#contact" class="smoothScroll"&gt;CONTACT&lt;/a&gt;&lt;/li&gt;
                              @*&lt;li&gt;@Html.ActionLink("Contact", "Contact", "Home")
                              &lt;/li&gt;*@
                          &lt;/ul&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>This is my Home controller:</p>
  
  <pre><code>public class HomeController : Controller
      {
          public ActionResult Index()
          {
              ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
  
              return View();
          }
  
          public ActionResult About()
          {
              ViewBag.Message = "Your app description page.";
  
              return View();
          }
  
  
  
          public ActionResult Contact()
          {
              ViewBag.Message = "Your contact page.";
  
              return View();
          }
  
          [HttpPost]
          [ValidateAntiForgeryToken]
          public async Task&lt;ActionResult&gt; Contact(EmailFormModel model)
          {
              string message2 = "There are a few errors";
              if (ModelState.IsValid)
              {
                  try
                  {
  
  
                      message2 = "Thanks! We'll get back to you soon.";
                      var body = "&lt;p&gt;Email From: {0} ({1})&lt;/p&gt;&lt;p&gt;Message:&lt;/p&gt;&lt;p&gt;{2}&lt;/p&gt;";
                      var message = new MailMessage();
                      message.To.Add(new MailAddress("nengelen@online.nl")); //replace with valid value
                      message.Subject = "Your email subject";
                      message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message);
                      message.IsBodyHtml = true;
  
                      using (var smtp = new SmtpClient())
                      {
                          await smtp.SendMailAsync(message);
  
                      }
  
  
  
                  }
                  catch (Exception error)
                  {
                      Response.Write("Error sending email: " + error.Message + "&lt;br /&gt; StackTrace: " + error.StackTrace);
                  }
                  ViewBag.Message = "Thank you for contact us";
                  //return new RedirectToActionAnchor("Contact", "", "#contact");
  
              }
  
              //if (Request.IsAjaxRequest())
              //{
              //    return new JsonResult { Data = new { success = true, message = message2 } };
              //}
  
              //TempData["Message"] = message2;
  
  
              return View("Home",model);
          }
      }
  </code></pre>
  
  <p>it seems that if I use this:return Redirect(Url.RouteUrl("Home") + "#contact"); the anchor(#) will be skipped</p>