title: Display Authorize Error Message in MVC from Action Method
body: <pre><code>[Authorize]
          public ActionResult Delete(string id= null)
          {
              UserDetail userdetail = db.UserDetails.Find(id);
              db.UserDetails.Remove(userdetail);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
  </code></pre>
  
  <p>This Delete method will work only for authorized users. For unauthorized users it is showing Server Error. 
  How to show Custom Authorization error message in this case so that it can be a user friendly error message.</p>