Dreamweaver Dynamic Web Page instance: Verifying user Registration

Source: Internet
Author: User
Tags comparison regular expression dreamweaver

Starting with this example, you will develop an e-commerce platform for a toy company based on the database and data connections created in instance 75. This example describes how to authenticate user registration information in the User registration page.

Effect description

The user registers as the company's customer through "uselogin.aspx", as shown in Figure 76-1, when the user submits the registration information, then it carries on the valid verification to the registration information, as shown in 76-2, thus carries on the management to the company's user registration information.

Creative Ideas

You can verify the user's registration information by asp.net the server control. This example needs to use the Dreamweaver KH table created in instance 75, as shown in Figure 76-3. This data table is used to store user registration information. User name (that is, usenmae) must be a unique value, user registration is generally defined as a non-advanced user (that is, the USEQL field is defined as a "no" value), only after the approval of the company administrator, the user is defined as an advanced user. If you have not yet been audited by a company administrator, the GLSC field will normally be defined as "no" and vice versa.

Operation Steps

Step One Design Basic page

(1) Create a dynamic page and insert the form. Create a new blank "asp.net" dynamic page, name it "uselogin.aspx," and save it in the site's base directory, insert the form first for the page, as shown in Figure 76-4.

(2) Define the form as the Server form. Because the ASP.net control must be added to the server form, you should define the form as a server form, as shown in Figure 76-5.

Tip: Since all asp.net controls must be added to a form containing runat= "server" and each asp.net page can have only one server form, it is recommended that the reader develop a habit of making any design of the asp.net first The page adds a Server Form [such as the steps in Figure 76-5 (1), Step (2)], which will be explained in detail in a later instance.

(3) Insert the table and make the style settings. Refer to the previous instance, design a table for the "uselogin.aspx" page in Design view and set the associated style, as shown in Figure 76-6.

(4) Add a text box for the "Customer name". Switch to the ASP.net shortcut menu bar, add a text box for customer name, and set the ID to Usename, as shown in Figure 76-7.

Tip: Enter the ID "Usename" in step 3 in Figure 76-7, which is the same as the corresponding field name "Usename" for the Dreamweaverkh table that will be stored. If you set the ID of the ASP.net control to be the same as the Read/save field name, the program executes more directly. The following controls, if not specifically described, have the same ID set as the field name that will be stored.

(5) Add and set the ASP.net control. Continue adding a text box to the user registration information and set the ID to the same field name, as shown in Figure 76-8. Where the "gender" corresponds to the Drop-down menu, the list items are set as shown in Figure 76-9; Confirm Password "The corresponding text box has an ID of" USEPASS1 ", and the text mode of the text box for password and Confirm password is" password ", as shown in Figure 76-10.

(6) Add the "Submit" button, as shown in Figure 76-11.

(7) Add a "Reset" Form button, as shown in Figure 76-12.

Step II Verify required information

(1) Add validation controls. After you move the cursor to the text box "Usename", add the validation control RequiredFieldValidator

(2) Add validation controls and fill in the contents. Add validation controls to the text box "Usename" in the pop-up Tag Editor-requiredfieldvalidator window and fill in the contents

(3) After completing the previous step, return to the label Selector dialog box and continue adding RequiredFieldValidator validation controls to the other required text boxes, as shown in Figure 76-15.

Tip: Make sure the text box "USPASS1" does not add a RequiredFieldValidator validation control because you can compare the input to the text box "Uspass" by CompareValidator the validation control. The corresponding Drop-down menu "Usesix" because only "male", "female" two options, so there is no need to add RequiredFieldValidator validation control, add "*" just to let users pay attention to correctly set their own gender.

Step three password comparison verification

(1) Open the Tag Selector dialog box. If the label Selector dialog box is currently open, select Validate server control under ASP. NET tags, select Asp:comparevalidator, and click the Insert button. If the Tag Selector dialog box is not currently open, click the More Labels button on the asp.net shortcut menu bar.

(2) Add a comparison validation control and set it. In the pop-up Tag Editor-comparevalidator window, add a comparison validation control for the text box "Usepass" to the "USEPASS1" text box, as shown in Figure 76-16.

(3) Click "OK" button to complete the CompareValidator validation control Add.

Step four verify e-mail

(1) Insert "Asp:regularexpressionvalidator". In the Label Selector dialog box, select Verify server Controls under ASP. NET tags, and select Asp:regularexpressionvalidator and click the Insert button.

(2) Add validation controls. Add a validation control to the text box "Useemail" in the pop-up Tag Editor-regularexpressionvalidator window

The validation expression for the control is: w+ ([-+.] w+) *@w+ ([-.] w+) *.w+ ([-.] w+) *.

Hint: The validation expression here is actually a regular expression. For the knowledge of regular expressions, please refer to the relevant information to deepen your understanding.

(3) Finally save "uselogin.aspx", and in IE preview.

This example explains whether server controls are non-null, server control comparisons, and custom three authentication methods for service control validation. If you want to use validation of a finer-grained server control, ask the reader to refer to the knowledge of the regular expression and customize the service control validation. This example completes the operation.

Note : For more wonderful tutorials, please pay attention to the triple web Design Tutorial section,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.