My ASP trip-two-level linkage menu production

Source: Internet
Author: User
This problem is actually quite old, but as I have just learned ASP3 months, it is necessary to write down to strengthen their basic knowledge.
Take the most commonly used "provincial and municipal Drop-down list linkage" as an example!
In our production of Web site membership registration information, usually involves filling in their own province/city, if the input or textarea made to fill out the form is not ideal. So most of the sites will choose to link down the form of the list, do not calculate very complex, at the same time it looks very relaxed.
The following are specific practices:
1. Design Database
We use an Access database. First, create a new Access database named Database1.mdb
In the Database1.mdb database, two tables were established for province and city. The specific fields are designed as follows:
Province (province)
Specific fields: id-automatic numbering provincename-province name provinceno-province name Number provinceorder-province sort number
Province
Id
Provincename
Provinceno
Provinceorder
1
Beijing
0
0
2
Anhui Province
1
1
3
Shandong Province
2
2
4
Jiangsu Province
3
3
The following province name is abbreviated.
Design idea: ID is the automatic number of the table, Provincename and Provinceno is necessary, the former is used to store the name of the province, the latter is the necessary field of Contact table City. As for the Provinceorder is used to order the name of the province, control the Drop-down list of the location of the province name, you can omit.
City (cities)
Specific fields: id-AutoNumber cityname-city name cityno-City name Number cityorder-City sort number provinceid-province number
City
Id
CityName
Cityno
Cityorder
Provinceid
1
Beijing
1
1
0
2
Hefei city
2
2
1
3
Wuhu city
3
3
1
4
Anqing city
4
4
1
5
Jinan city
5
5
2
6

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.