I am using FormsAuthentication and ASP.NET Memberships and Roles in my ASP.NET project. I have some aspx files which can be viewed / accessed by only authenticated users. I think I can do this using one of the following two ways.
Configuring the web.config file. Allow users with roles 'admin' and 'members' to access those apsx files, and deny all other anonymous users.
In page_load events of those apsx files, just checking whether the curent user is authenticated or not using
HttpContext.Current.User.Identity.IsAuthenticated
I am wondering whether these two approaches are equivalent or not for apsx files.