Rookie learns to use Dreamweaver to do ASP1

Source: Internet
Author: User
Dreamweaver Original Author: cnbruce

Follow the steps to

The first step: Server Configuration Chapter

1, turn on the computer, set up a folder under D disk NEWGN (this clip is your site storage point), and built several subfolders inside (like the subdirectory of your site)

2, go back to Newgn's root directory and right-click "Sharing and security" (in fact, create a virtual directory quickly)

3, when the Properties dialog box appears, select the "Web Share" tab, click "Shared Folders", the Sharing Alias dialog box appears, choose the silent settings, OK.

4, supplementary explanation. Setting up a Web share is actually setting up a virtual directory for IIS. You can see that the default Web site in IIS already has NEWGN (note: My OS is win2003, in fact, about the operation of IIS.) such as: Win2K inside Open IIS---Local computer---default site)


5, the above steps completed the establishment of the station, set up a virtual directory, the following is the Dreamweaver opened. The first step is to "edit the site."

6, select "Edit Site", in the Pop-up property box to select "Advanced" tab, from the "classification" of the first "local information", the right window set the site name (casually input, but you have to know the meaning of their behalf, recommended and your site root file name with), Local root folder (this is the point to the folder we built in step 1).

7, and then set the remote information, Access select "Local/Network", the remote folder still select our site folder d:\newgn\

8, then "Test Server", "Server Model" for ASP Javascript, "Access" local/network, "Test server folder" is still our site folder d:\newgn\, "URL prefix" added after http://localhost " Newgn/", the added thing is the virtual directory we set up in step 3

9, at this time, the site definition is basically finished, click OK. The Edit Site dialog box appears, complete.

10, at this time DW's Site property box will be d:\newgn\ all the content mapped, in this need to remind is: DW built a site connection, you can directly in the DW of its corresponding file, folder operation, it is best not to go back to my computer d:\newgn\ inside to operate. "Be able to operate in the DW, try not to leave the DW's editing environment"

The rest is to create a new ASP page, the specific implementation of what functions, hehe, to be continued ...

Step Two: Database Setup Chapter

1, first confirm that the site root directory has a special database storage directory, such as d:\newgate the following databases folder (there is OK, no new).

Next, open the Microsoft Access DBMS, the file---new ... "database, select the store path in the pop-up dialog box and name it.

2, in the new database "Use designer CREATE TABLE", pop-up "Table 1" in the design of your related fields, pay attention to their "data type", but also important: Field ID, type AutoNumber, and select it as the primary key.

3, after the design of "Table 1", directly close the window, in the pop-up dialog box click "Yes" to save "Table 1" named user.

at this point you need to mention that the setting of the field ID that you just emphasized is necessary, otherwise the following dialog box will appear after the save, and the effect is to set the type to be the key field for AutoNumber.

4, the database table user has been established.

5, double-click the database table user, add a try, and enter the relevant content in the user table that pops up. Close save.

At this point the database, table, field, the establishment of the save work finished. The following starts using DW to manipulate MDB files.

Step Three: Database display Chapter

Site has been built, DW also managed, database tables have been built, but also a little Tim. That's it. DW is also a powerful feature: connect the database and display the record.

1, open the DW, the site inside the first new ASP page (index.asp). Select the Database tab in the Applications panel. As soon as we set up the site in front, select the document type (that is, our choice of ASP JavaScript) and also test the server (http://localhost/newgn/); now we see that the fourth step left is not ticked.

Now click on the "+" number and select "Custom connection string".

2, in the bounce out of the Custom Connection string dialog box, "Connection name" casually write one. The "connection string" should be filled out properly. Apply absolute path when "use driver on this computer": Driver={microsoft access DRIVER (*.mdb)};D bq=d:\newgn\database\cnbruce.mdb Otherwise "use the driver on the test server "MapPath conversion path: Driver={microsoft Access Driver (*.mdb)};D bq=" & Server.MapPath ("/newgn/database/cnbruce.mdb") Note: If you want to upload to the Web page can be directly used MapPath.

Click "Test", the success is cool.

Note: For more information, you can open the help tutorials for DW.

3, a successful connection to the database, in the DW is actually automatically generated a connection file. The location in the Auto-generated Connections folder, the name you just made in the "Custom connection string" is simply knocking on the named ASP file. You can also notice that the various fields within the MDB file are visible within the DW Database tab.


4, the file to connect to the database is there, but below our specific single page how and database hook it. Select the Bindings tab and add the recordset (query). Just to see the literal meaning is to come to the SQL query statement.

5, in the pop-up "recordset" window, "name" casually write a bar, also can not write, the default. But "connection" is going to select the connection object you defined from the Drop-down list, and the "table" continues to drop the selection (note: This is related to several tables when designing the database).

6, other casually look at, in fact, the most important thing is automatically generated SQL language, click "Advanced ...", you can see the following figure

7, when you are sure, you will find that the recordset is already bound and all the fields in the database are visible.

Notice the Insert button below, and you can select a field, or press the button or drag it to the Index.asp page. The ASP page displays the contents of the database. But only the first row, to show all .... Next

8, in the Insert Toolbar Application tab, select Dynamic table.

9, the pop-up dynamic table to select the set of records that have been set, showing a few records are clear that is the generation of paging program: The record of more data, more content, on several pages to display, a few pages. Records are automatically generated by using a table, and then set the properties of the table.

The following results are determined:

10, can tell you, basically almost. F12 look at the effect

So now for a paragraph, you have learned how to connect the database, how to display the records in the library table. Waiting for you is how to insert new records, how to modify records and so on ....

Fourth Step: Registration system article

1, right in the site to create a new file regist.asp to do the registration page, as well, because before this has been built and the database connection of the file conn.asp, the file is a full site valid. So "conn" is automatically available in the "apps"----"Database" tab in your new regist.asp. This step is to start with the first step, not to be added later (unless you want to connect to another database).

2, and then the old rules, switch to the Bindings tab and add the recordset. (I think it should be a few steps to get started) after the addition of a good picture is still the old face.

3, in the Regist.asp page to make a very simple form page, content and form table Single-name best and the database tables corresponding to the field.

4, select the form form tag at the code label, primarily to prepare for the next insert record. Always note that when you want to set the associated property action on a block, be sure to select it.

5, switch to the Server Behavior tab because the recordset was previously bound in step 2nd, so it is normal to have a recordset in the label content. But we want to insert the record, continue to press "+", select "Insert Record".


6, in the "Insert Record" dialog box that pops up. "Connection" is chosen by you; "INSERT into table" let it be; after inserting, go to "means that after the successful registration to jump to a page prompts, write first, but remember to build this page immediately;" Get value from "is the form name you just selected;" Name is inserted into column name in form element. " This means that the contents of the name input box in the form are inserted into the database table name field.

at this point understand why in step 3 "Content and form table single-name the best and database tables and fields corresponding to the", DW automatic intelligent insertion, otherwise you have to choose one point.

7, after the confirmation, the registration system has been completed more than half. (My normal time is less than 1 minutes, the main is a lot of practice) but again think of the registration system is not allowed to duplicate it? It's going to continue to add some content.

in server behavior, continue to press +, and select "Check new user name" in user authentication.

8, also in the pop-up "check New User Name" dialog box, the User name section select "Name" means not to register, of course, can also choose other, such as email, meaning that the same emai can only register one. "If it exists, go to" to indicate what to do if there is a repetition of the phenomenon? Then jump to an error page prompt. Of course, this page has not been built, first write a document, and just as registok.html remember to fill up immediately.

9, do some details of the action, such as the form inside which must add ah, which must be a number ah, email address to include a @ and two "." No, wait a minute. Note Select the Submit button first. In the design panel behavior, select Detect form. The pop-up dialog box can be easily set to click on the

10, and then do not have just two pages: Registok.html and registbad.html

Registok.html page content is probably: Registration is successful, please login (of course, the login system is the next article I want to write).

Registbad.html page content is probably: Oh, sorry, have this user, or trouble you re-register. Return!

Also note that the "password hint problem" and "password hint answer" also fill in, later on "Retrieve the password system" will be used.

Registration system on this side, the main is to insert records, and verify the effect of the duplicate. Oh, login system written in ...

Fifth step: Landing System article

1, in the site right key to create a new file login.asp used to do the login page; Similarly, previously had built and database connection file conn.asp. So "conn" is automatically available in the "apps"----"Database" tab in your new login.asp.

2, as with the registration page, you need to go to the "+" Recordset under the Bindings tab of the application panel. Click "Test" when you have finished selecting in the pop-up window to see the relevant records in the current database that meet the SQL conditions.

Note: This figure shows the relevant content in the database, name:cnbruce,pwd:123456 and name:cnrose,pwd:123456. Remember it, it can be used when we test the login.

3, the form form is made in the login page, and the input text box is properly named.

4, click the form tag to select the entire form in the design page.

5, select "+"----"User authentication"----"Log on user" in the "Server Behavior" in the Applications panel.

6, the pop-up dialog box to make specific settings. Getting input from form means selecting a specific form form from this ASP page and the required user name and password fields in the form.

Connection verification indicates that connection settings are made through conn files and database tables. Select the user table, which lists the names of users and passwords in the database for a specific username and password field. It is obvious that the contents of the fields in the library and the content submitted in the form are validated compared to the connection.

"Login successful, go to" loginok.asp, the page is a permission page, only when the login is completely correct to enter. Otherwise login failed, go to loginbad.html.



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.