<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LoginTemplate.aspx.cs" Inherits="LoginTemplate" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <mce:script runat="server"><!-- protected void Login_Authenticate(object sender, AuthenticateEventArgs e) { e.Authenticated = FormsAuthentication.Authenticate(Login1.UserName, Login1.Password); } // --></mce:script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>使用模板定制Login控件</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Login ID="Login1" runat="server" DestinationPageUrl="~/Login.aspx" OnAuthenticate="Login_Authenticate"> <LayoutTemplate> <asp:Label ID="FailureText" EnableViewState="false" runat="server" /> <br /><br /> <asp:Label ID="lblUserName" AssociatedControlID="UserName" Text="UserName:" runat="server"> </asp:Label> <br /> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <br /><br /> <asp:Label ID="lblPassword" AssociatedControlID="Password" Text="Password:" runat="server"> </asp:Label> <br /> <asp:TextBox ID="Password" TextMode="Password" runat="server"> </asp:TextBox> <br /> <br /> <asp:Button ID="btnLogin" Text="Login" CommandName="Login" runat="server" /> </LayoutTemplate> </asp:Login> </div> </form> </body> </html>
posted on 2010-05-20 16:12 java课程设计 阅读(245) 评论(0) 收藏 举报