title: How can I redirect users, who or not logged in to login page, in C# MVC 4.5 if they try to access other site pages via URL
body: <p>I have one website, where I want users to be redirected to "Login" page if they are not signed in. The users may try to access the webpages by posting url. I want to do it in C# MVC 4.5</p>
  
  <p>Here I dont want the action "[Authorize]" to be available unless signed in.
  It is index action to view index page.</p>
  
  <pre><code>  //Login Controller
    [AllowAnonymous]
    public ActionResult Index()
    {
        return View();
    }
    [HttpPost]
     public ActionResult Index(FormCollection frm)
      {
          ....//other code
      }
  
   [Authorize]
   public ActionResult Index()
      {
          List&lt;DTO&gt; obj = objConfigurator.GetDataList();
          return View(obj);
      }
  
  
      public ActionResult Edit(int Id)
      {
          DTO obj = objC.GetListById(Id);
          return View(obj);
      }
  </code></pre>