Today, I was owndering if I could use the [Authorize] attribute with regions in C#
I never found a satisfying answer, but I think I found an answer
[Authorize(Roles = "Admin")]
#region testRegion
// GET: /Home/Index
public virtual ActionResult Index()
{
return View();
}
#endregion
With this code, only users with the "Admin" role can see this page