title: ASP.ne MVC Return to pervious page after submitting form _ index action overload for httppst
body: <p>I Have a Form that I want to return to previous Page after submitting. </p>
  
  <p>everything works correctly but I have a question of how to overload index</p>
  
  <p>Create action redirect to index action of <code>Tour Controller</code>
  here is my <code>index</code> action </p>
  
  <pre><code>public ActionResult Index(string country)
      {
  
          if (country == null)
          {
              return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
  
          }
  
          Country c = db.Countries.Where(e =&gt; e.CountryName.ToLower() == country.ToLower()).First();
  
          ViewBag.ResultMessage = TempData["ResultMessage"];
          ViewBag.Country = c.CountryName;
          TempData["Country"] = c.CountryName;
          var tours = db.Tours.Where(e =&gt; e.CountryId == c.Id);
  
          var vm = new TourRequestViewModel { Tours = tours.ToList(), Request = new Models.Request() };
  
          return View(vm);
  
      }
  </code></pre>
  
  <p>My question is how I can have an <code>overload</code> for <code>index</code> with <code>[HttpPost]</code> with same arguments(if possible somehow) or how to change arguments that I can set an [HttpPost]overload for index method.</p>
  
  <p>My Create action If needed :</p>
  
  <pre><code>[HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create([Bind(Include = "Id,TourId,FirstName,LastName,Email,Phone,Comment,FrequentTraveler,TravelersCount,Date,ContactTimePreference,Country,Archived")] Request request)
      {
          if (ModelState.IsValid)
          {
              db.Requests.Add(request);
              db.SaveChanges();
  
              TempData["ResultMessage"] = "Form  Posted successfully.";
              return RedirectToAction("Index", "Tour", new { country = TempData["Country"] });
          }
          TempData["ResultMessage"] = "Try Again!";
          return RedirectToAction("Index", "Tour", new { country = TempData["Country"] });
      }
  </code></pre>
  
  <p>my Route Config if needed:</p>
  
  <pre><code>routes.MapRoute(
             name: "TourRoute",
             url: "{country}/tours",
             defaults: new { controller = "Tour", action = "Index" }
         );
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );
  </code></pre>
  
  <p>Appreciate you help.</p>