Creating a Secure Base Page class for ASP.NET Pages
Every web application developed using .NET as application framework needs authentication as well as authorization. ASP.NET provides 2 types of authentication providers for the web applications, namely Windows Authentication Provider and Forms Authentication Provider . Am not going to discuss these types and various modes of authentication. But am going to write about how one can implement a code to secure their web pages. And specially if these pages require some kind of user login is a mandatory. First, you create any page that is supposed to be secured, say for instance AccountDetails.aspx. This page by default takes the inheritance from System.Web.UI. Page class. Now that you have created the page, it is the time for you to induce the security for this page. So add a new class to your application and name that as SecureBasePage .CS. This class is now inherited from System.Web.UI. Page class. The code would look like below public class SecureBasePage : System.Web.UI. Page { pub...