00001: <%@ Page Language="VB" MasterPageFile="~/M1.master" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="login"  %>
00002: <%@ MasterType VirtualPath="~/M1.master" %>
00003: <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
00004:     <asp:Login ID="Login1" runat="server" LoginButtonText="Войти" PasswordLabelText="Пароль:"
00005:         RememberMeText="Помнить меня" TitleText="Вход" UserNameLabelText="EMail:" DestinationPageUrl="<%$ appSettings:CollectorPage %>" PasswordRecoveryText="Забыл пароль" PasswordRecoveryUrl="~/RestorePass.aspx">
00006:         <TitleTextStyle Font-Size="Small" />
00007:         <CheckBoxStyle Font-Size="Small" />
00008:         <LabelStyle Font-Size="Small" />
00009:         <HyperLinkStyle Font-Size="Small" />
00010:         <InstructionTextStyle Font-Size="Small" />
00011:         <TextBoxStyle Font-Size="Small" />
00012:         <ValidatorTextStyle Font-Size="Small" />
00013:         <FailureTextStyle Font-Size="Small" />
00014:     </asp:Login>
00015: </asp:Content>

00001: Partial Class login
00002:     Inherits System.Web.UI.Page
00003: 
00004:     Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
00005:         If Membership.ValidateUser(Login1.UserName, Login1.Password) Then
00006:             If Request.UrlReferrer.PathAndQuery.Contains("login.aspx") Then
00007:                 'чтобы не было зацикливания
00008:                 Login1.DestinationPageUrl = [GoTo].UserHomePage
00009:             Else
00010:                 Login1.DestinationPageUrl = Request.UrlReferrer.PathAndQuery
00011:             End If
00012:             e.Authenticated = True
00013:         Else
00014:             Login1.DestinationPageUrl = System.Configuration.ConfigurationManager.AppSettings("CollectorPage")
00015:             e.Authenticated = False
00016:         End If
00017:     End Sub
00018: 
00019: End Class


Comments ( )
Link to this page: //www.vb-net.com/asp2/35/5.htm
< THANKS ME>