I want to display an custom error page for code 401 , if the user is not authorized to view any particular part of my webApplication. Kindly solve my problem.
What I have tried:
This is my web.config file:
This is My Controller:
[HandleError]
public class HomeController : Controller
{
[Authorize]
public ActionResult SecureMethod()
{
return View();
}
[AllowAnonymous]
public ActionResult NonSecureMethod()
{
return View();
}
I have also enabled the Windows Authentication and Anonymous Authentication on IIS Server

Catcher WongPosted Aug 16, 2017, 8:46 AM
arvind baldaniyaPosted Aug 19, 2017, 3:21 AM