如何使用安全问题和地址簿为asp.net创建注册表单 [英] how to create registration form for asp.net with security question and address book
本文介绍了如何使用安全问题和地址簿为asp.net创建注册表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何编辑asp.net for aspnetdb表的注册表格,并将安全问题,地址和手机号码添加到以下代码?
how to edit the register form asp.net for aspnetdb table and add security question, address and mobile number to the following code?
<asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false"
OnCreatedUser="RegisterUser_CreatedUser" ForeColor="White">
<LayoutTemplate>
<asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<WizardSteps>
<asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
<ContentTemplate>
<h1 class="pagetitle">
Create a New Account
</h1>
<br />
<p style="color: #FFFFFF">
Use the form below to create a new account.
</p>
<br />
<p style="color: #FFFFFF">
Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
</p>
<span class="failureNotification">
<asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="RegisterUserValidationGroup"/>
<div class="accountInfo">
<fieldset class="register">
<legend style="color: #FFFFFF">Account Information</legend>
<p>
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"
ForeColor="White">User Name:</asp:Label>
<asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email"
ForeColor="White">E-mail:</asp:Label>
<asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required."
ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"
ForeColor="White">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="ConfirmPasswordLabel" runat="server"
AssociatedControlID="ConfirmPassword" ForeColor="White">Confirm Password:</asp:Label>
<asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic"
ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server"
ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword"
CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
</p>
</fieldset>
<p class="submitButton">
<asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User"
ValidationGroup="RegisterUserValidationGroup" CssClass = "redButton"/>
</p>
</div>
</ContentTemplate>
<CustomNavigationTemplate>
</CustomNavigationTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
推荐答案
另请参阅以下链接
<啊ref =http://www.4guysfromrolla.com/articles/050609-1.aspx> http://www.4guysfromrolla.com/articles/050609-1.aspx [ ^ ]
Also refer following link
http://www.4guysfromrolla.com/articles/050609-1.aspx[^]
如果点击来源,有这种层次结构:_
If you click on the Source, there is this hierarchy: _
<asp:CreateUserWizard runat="server" ID="RegisterUser" ViewStateMode="Disabled" OnCreatedUser="RegisterUser_CreatedUser">
<LayoutTemplate>
<asp:PlaceHolder runat="server" ID="wizardStepPlaceholder" />
<asp:PlaceHolder runat="server" ID="navigationPlaceholder" />
</LayoutTemplate>
<WizardSteps>
<asp:CreateUserWizardStep runat="server" ID="RegisterUserWizardStep">
<ContentTemplate>
<p class="message-info">
Passwords are required to be a minimum of <%: Membership.MinRequiredPasswordLength %> characters in length.
</p>
<p class="validation-summary-errors">
<asp:Literal runat="server" ID="ErrorMessage" />
</p>
<fieldset>
<legend>Registration Form</legend>
<ol>
<li>
滚动到最后列表并插入此代码:
Scroll to the end of the list and insert there this code:
<li>
<asp:Label ID="Label1" runat="server" AssociatedControlID="SecurityQuestion">Security Question</asp:Label>
<asp:Label ID="Label4" runat="server" AssociatedControlID="SecurityQuestion">This is an security code:</asp:Label>
<asp:Label ID="SecurityAnswer" runat="server" AssociatedControlID="SecurityAnswer">QR45lt0</asp:Label>
<asp:TextBox runat="server" ID="tbSecurityQuestion" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbSecurityQuestion"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Security Question field is required." />
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="SecurityAnswer" ControlToValidate="tbSecurityQuestion"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Security answer was wrong." />
</li>
<li>
<asp:Label ID="Label2" runat="server" AssociatedControlID="Address">Address</asp:Label>
<asp:TextBox runat="server" ID="tbAddress" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbAddress"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Address field is required." />
</li>
<li>
<asp:Label ID="Label3" runat="server" AssociatedControlID="MobileNumber">Mobile Number</asp:Label>
<asp:TextBox runat="server" ID="tbMobileNumber" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbMobileNumber"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Mobile Number field is required." />
</li>
I hope this helped!
If you want it for the database, just use tbMobileNumber.Text and tbAddress.Text as parameters for your OracleCommand or SqlCommand.
Pepin z Hane
I hope this helped!
If you want it for the database, just use tbMobileNumber.Text and tbAddress.Text as parameters for your OracleCommand or SqlCommand.
Pepin z Hane
这篇关于如何使用安全问题和地址簿为asp.net创建注册表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文