Use System.Web.HttpContext.Current.Session
and System.Web.HttpContext.Current.Response
to get a reference to the Session and Response objects form within a class.
Delete line Imports System.Web.HttpContext.Current.Session
If System.Web.HttpContext.Current.Session
("UserID".ToString = "" Then
System.Web.HttpContext.Current.Response.Redirect("myPage.aspx"
End If
Not sure though if it'll do a redirect from within the class, never tried that.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.