Check if you use class production

xiaoxiao2021-03-06  83

Method: Make a class as follows in your file, change your file to inherit this class, that is, public class webform2 inherits system.Web.ui.page is changed to public class _default12 inherits aspnet.starterkit.communities.BaseispadminPage class is as follows: Imports SystemImports System.Webimports System.Web.ui

'********************************************************** *************************** The ISPADMIN PAGES Derive from this class. '' '* *********************************************************** ******************

Public class baseispadminPage inherits page

Protected Overrides Sub Oninit (Byval E As Eventargs) MyBase.onit (E)

'Check security If Request.Cookies ( "ISPAdmin") Is Nothing Then Response.Redirect ( "~ / ISPAdmin / IspLogin.aspx") End If' Get the username and password from session cookies Dim username As String = Request.Cookies ( " ISPADMIN "). Values ​​(" UserName ") Dim Password As String = Request.Cookies (" Ispadmin "). Values ​​(" Password ")

'If bad username or password, redirect If username.ToLower () <> CommunityGlobals.IspUsername.ToLower () OrElse password.ToLower () <> CommunityGlobals.IspPassword.ToLower () Then Response.Redirect ( "~ / ISPAdmin / IspLogin. ASPX ") end if End sub 'Oninit End Class' BaseispadminPage Source: www.asp.net Project: ASP.NET Community Starter Kit (VBVS)

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

New Post(0)