I have something like this:
public ActionResult Index(int id)
{
if (UserHasPermission())
{
return View()
}
throw new HttpException(403, "You do not have permission");
}
and in my web.config I set this:
<customErrors mode="On">
<error statusCode="403" redirect="/Error/403" />
</customErrors>
I want to know how to get this message 'You do not have permission' when the redirect to Error/403 is done.