title: Asp.net mvc How to prevent browser from calling an action method?
body: <p>I have two actions inside my controller (shoppingCartController)</p>
  
  <pre><code>    public ActionResult Index()
      {
          //some stuff here
          return View(viewModel);
      }
  
  
      public ActionResult AddToCart(int id)
      {
  
          return RedirectToAction("Index");
  
      }
  </code></pre>
  
  <p>Is there anyway to prevent the users from directly calling the index action by typing the url in the browser?</p>
  
  <p>For example: If the user browses to <code>shoppingCart/index</code> be redirected to Home/Index.</p>