logincontrol.ascx

来自「C#语言制作asp.net网上商店的」· ASCX 代码 · 共 183 行

ASCX
183
字号
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="LoginControl.ascx.vb" Inherits="Shop_Controls_LoginControl" %>
<center >
<table border="0" cellpadding="0" cellspacing="15" width="70%">

<tr>
<td  style="text-align :left;  vertical-align :top ; width:50%;">

           <div >
   <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/Shop/newcheckout_returncustomer.gif" />

</div>
<div id="Pannel"  style ="border-width:2px;  ">

        <asp:Login ID="LoginUser" runat="server" LoginButtonImageUrl="~/Images/Shop/newcheckout_continue.gif"
            LoginButtonType="Image" MembershipProvider="NSFMembershipProvider" Width="350px" FailureText="对不起,用户名或密码不正确,请重新输入!">
            <LayoutTemplate>
            
 


<div class="title">
    <asp:Label ID="lblogin" runat="server" Text=" 已有帐户用户在这里登陆."></asp:Label>   </div>

       <table border="0" cellpadding="0" >
                       
                                                        <tr>
                                    <td  style="height: 30px; width: 74px;">
                                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" Font-Bold="True">用户名:</asp:Label></td>
                                    <td style="width: 264px">
                                        <asp:TextBox ID="UserName" runat="server" Width="180px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                            ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td  style="height: 30px; width: 74px;">
                                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Font-Bold="True">密码:</asp:Label></td>
                                    <td style="height: 30px; width: 264px;">
                                        <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                            ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="height: 20px">
                                        <asp:CheckBox ID="RememberMe" runat="server" Text="下次记住我。" /></td>
                                </tr>
                        
                            <tr  valign="top">
                                <td class="FormInside" colspan="2" align="left">
                                    <a href="javascript:void window.open('ForgotPassword.aspx','PopUpPassword','width=500,height=300,resizable=yes,menubar=yes,location=yes,status=yes,scrollbars=yes');"><span style="text-decoration: underline">忘记密码点击这里?</span></a>
                                </td>
                            </tr>
                                <tr>
                                    <td  colspan="2" style="color: red">
                                    <div>                         <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Login1" /></div>
                                    <div>       <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
               </div>
                                 
                                      </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:ImageButton ID="LoginImageButton" runat="server" AlternateText="Log In" CommandName="Login"
                                            ImageUrl="~/Images/Shop/newcheckout_continue.gif" ValidationGroup="Login1" />
                                    </td>
                                </tr>
                            </table>


            </LayoutTemplate>
        </asp:Login>
</div>

</td>

<td  style ="text-align:left;width:50%;vertical-align :top ;">
                   <div>                              <asp:Image ID="Image4" runat="server" ImageUrl="~/Images/Shop/newcheckout_newcustomer.gif" /></div>   
                                   <div id="Pannel" style ="border-width:2px;  ">              
                   
                        <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"    CreateUserButtonType=Image
                         emailregularexpression='@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"'
                         CreateUserButtonImageUrl="~/Images/Shop/newcheckout_continue.gif" MembershipProvider="NSFMembershipProvider" InvalidPasswordErrorMessage="密码最短长度为 {0}。" Width="350px" >
                            <WizardSteps>
                                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                                <ContentTemplate>
                                      
                       
                                   <div class="title">
                                       <asp:Label ID="lbRegister" runat="server" Text="                                 首次使用用户请在这里注册新帐户."></asp:Label>      
                                   </div>
                                              <table  border="0" cellpadding="0" cellspacing="2" >
                          <tbody>
                       
                     
                       <tr>
                              <td style="width: 79px">
                                  <asp:Label ID="Label1" runat="server" AssociatedControlID="UserName" Font-Bold="True">
用户名:</asp:Label></td>
                              <td align="left" style="width: 220px">
                              <asp:TextBox ID="UserName" runat="server" Width="180px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="UserName"
                                      ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                              <td style="height: 30px; width: 79px;">
                                  <asp:Label ID="Label4" runat="server" AssociatedControlID="Email" Font-Bold="True">电子邮件:</asp:Label></td>
                              <td align="left" style="width: 220px" >
                                                    <asp:TextBox ID="Email" runat="server" Width="180px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Email"
                                      ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                              <td style="height: 30px; width: 79px;">
                                  <asp:Label ID="Label2" runat="server" AssociatedControlID="Password" Font-Bold="True">密码:</asp:Label></td>
                              <td align="left" style="width: 220px">
                                                    <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="180px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Password"
                                      ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="Email" ErrorMessage='请输入一个有效的电子邮件地址。' ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                      ValidationGroup="CreateUserWizard1">*</asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                              <td style="height: 30px; width: 79px;">
                                  <asp:Label ID="Label3" runat="server" AssociatedControlID="ConfirmPassword" Font-Bold="True">确认密码:</asp:Label></td>
                              <td align="left" style="width: 220px"  >
                                                    <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" Width="180px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ConfirmPassword"
                                      ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                                      ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                                    <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                                        ControlToValidate="ConfirmPassword" ErrorMessage='“密码”和“确认密码”必须匹配。'
                                                        ValidationGroup="CreateUserWizard1">*</asp:CompareValidator></td>
                            </tr>
                            <tr>
                              <td colspan="2" align="left" style="color: red" rowspan="4" ><div>  <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="CreateUserWizard1" />
                                    </div><div>                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False">            </asp:Literal></div>
                    
                             
                         
                              </td>
                            </tr>
  
                        
                    
                        </table> 
                                   
                       
                              
                                </ContentTemplate>
                                    <CustomNavigationTemplate>
                                        <table border="0" cellspacing="5" style="width: 100%; height: 100%">
                                            <tr align="right">
                                                <td align="center" colspan="0">
                                                    <asp:ImageButton ID="StepNextButton" runat="server" AlternateText="Create User" CommandName="MoveNext"
                                                        ImageUrl="~/Images/Shop/newcheckout_continue.gif" ValidationGroup="CreateUserWizard1" />
                                                </td>
                                            </tr>
                                        </table>
                                    </CustomNavigationTemplate>
                                </asp:CreateUserWizardStep>
                  <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
           
                    <p>
                       <div id="title"> <asp:Label ID="lbThanks" runat="server" Text="感谢你!你已经成功注册本站帐户."></asp:Label></div><p>
                    </p>
                                    
                    <p >
                        <asp:HyperLink ID="hlShopping" runat="server" Text ="继续在本站购物." NavigateUrl ="~/Default.aspx"></asp:HyperLink></p>
                    <p>
                        <asp:HyperLink ID="hlAccount" runat="server" Text ="完善你的帐户信息!" NavigateUrl ="~/User.aspx"></asp:HyperLink></p>
                        <p></p>
                </ContentTemplate>
            </asp:CompleteWizardStep>
                           
                            </WizardSteps>
                        </asp:CreateUserWizard>
                                                                                       </div>
                                           
                </td>
</tr>
</table>


 
 </center>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?