Some time to study the problem of login verification of the background, I heard that Forms authentication is convenient, so it is found that the information on the Internet is not full (or not suitable for beginners), there is a lot of problems, now I put it My code is published, I hope to give you some help. My background file is all in the admin directory, the login port of the background is admin_login.aspx, and the functionality to be implemented is: Can't directly access the Admin Directory In addition to admin_login.aspx (Ie the files outside the login port), but the front desk file, such as Default.aspx, etc., should not be affected by Forms verification, that is, even if there is no login, access Default.aspx, can not go to Admin_login.aspx Let's talk about the implementation process: in the web.config file, set to Forms authentication:
Response.Redirect ("admin_index.aspx");} The above is the implementation process of Forms authentication, I hope to be useful to you. If you have any questions, please leave a message here, I will reply.