Check the login information in the ASP.NET, use the global process PCSKY (original)

zhaozj2021-02-16  104

'Write in module1.vb, can be built by any page to create, test through' PCSKY http://blog.9cbs.net/lee2001XPASP, you can also write in .NET. , Do not recommend <% IF session ("UserName") <> "" "Login.aspx") End IF%> ASP.NET Writings, placed in module1.vbmodule module1sub checkuser () "Check User Information If httpcontext.current.Session ("Username") = "" "" "Login.aspx") end ifnd suend module is added to the page you need to verify: Private SUB Page_Load (Byval Sender AS System.Object, Byval e as system.eventargs Handles mybase.load call checkuser () 'Check the login information End Sub Advantages: 1. Implement the separation of pages and code, improve performance 2. Code standardization, use global processes, reduce code redundancy The balance is relatively simple, I hope everyone can throw the jade! ^ _ ^

转载请注明原文地址:https://www.9cbs.com/read-14354.html

New Post(0)