Imports BVSoftware.BVC.Core Imports System.Web.Security Public Class login2 Inherits BaseStorePage Protected WithEvents MetaDescriptionControl As BVSoftware.WebControls.MetaTag Protected WithEvents MetaKeywordsControl As BVSoftware.WebControls.MetaTag Protected WithEvents TitleLabel As System.Web.UI.WebControls.Label Protected WithEvents TrailHomeLink As System.Web.UI.WebControls.HyperLink Protected WithEvents LoginControl1 As LoginControl Protected WithEvents CSSTag1 As BVSoftware.WebControls.CSSTag Protected WithEvents NewUserControl1 As NewUserControl #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() 'SP2- Assures that SSL is used for this page if set up Me.RequiresSSL = True '-SP2 End Sub #End Region Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then MetaKeywordsControl.Content = WebAppSettings.MetaKeywords MetaDescriptionControl.Content = WebAppSettings.MetaDescription CSSTag1.StyleSheetURL = PersonalizationServices.GetPersonalizedStyleSheet Me.TitleLabel.Text = Content.SiteTerms.GetTerm("Login") PageTitle = Content.SiteTerms.GetTerm("Login") If Request.Params("ReturnURL") <> Nothing Then ViewState("ReturnURL") = Request.Params("ReturnURL") End If PopulateRememberedUsers() End If End Sub Private Sub RedirectOnComplete() If Not ViewState("ReturnURL") Is Nothing Then Response.Redirect(ViewState("ReturnURL")) Else Response.Redirect("myaccount_Orders.aspx") End If End Sub Private Sub PopulateRememberedUsers() Dim checkCookie As HttpCookie checkCookie = Request.Cookies(WebAppSettings.UserCookieName) If Not checkCookie Is Nothing Then Me.LoginControl1.UserName = checkCookie.Value End If checkCookie = Nothing End Sub Private Sub LoginControl1_LoginCompleted(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginControl1.LoginCompleted, NewUserControl1.LoginCompleted RedirectOnComplete() End Sub End Class