Using Dreamweaver mx to build a simple book query system (2)

Source: Internet
Author: User
Tags filter contains prev query variable dreamweaver
dreamweaver| Query System Third,Make a page that is displayed by category query
1, a new Dynamic Web page, named Xianshi.asp.
2, set up a recordset. Select the Bindings tab in the Application panel, press the plus button, select the recordset (Query), eject the recordset dialog box, the settings in Figure 13, name Recordset2, database table Select Tushu, Because the page display of the book information is based on the previous query conditions to display, so you need to set a limit to select the conditions of the book, then this condition is through what to achieve transmission and acceptance of it? This requires the URL Parameter (url parameter), which can be used to pass query criteria from the Query Web page, and then accept this parameter in the Display Web page to display the records that match. The specific use of the following methods:

Figure 13 (1) Let's go back to the query page chaxun.asp. With the mouse to select the field in the table, and then select the application panel on the Server Behaviors label, press the plus button, select Go to Detail page (to the Detail page), pop-up the went to Detail Page dialog box, specific settings such as Figure 14. Detail page is our display webpage xianshi.asp,pass url parameter text box entered is to pass through the URL to the detail page of the parameter name, for the sake of understanding, we enter "category name", The name can be the same as the name of the parameter that is set in the following display page. Where the recordset means to pass out from which recordset, we choose Recorset1,column meaning as the source of the URL parameter value, to be consistent with the query criteria on the query page, so select category name, pass Existing Parameters these two options are related to the form, and the form is not used on this query page, so you can not select it. By clicking the OK button, you can see that the field in the table has become a hypertext connection that contains dynamic content.

Figure 14
(2) OK, URL parameter has been set, and now return to the Display page xianshi.asp to accept this parameter. Select the recordset (query), Pop the recordset dialog box, and set the filter to Figure 13, which means that the query condition for the field "category name" in table Tushu is equal to the URL parameter parameter "category name" passed over. This way, the query page and the display page are linked.
(3) test by clicking the Test button. You can enter a category name, DW will display the corresponding book records.
(4) Click OK button to return to the page, set up the recordset.
3, the input of static content in the Web page, such as Figure 15, where the "back" link to the query page chaxun.asp, because there are more categories of books, so the display is set to page display.

Figure 15
4, using the method described above, drag the field of the recordset to the corresponding position on the page, as shown in Figure 16.

Figure 16
5, select the second line in the table, click on the application panel in the server behaviors tag, press the plus button, select Repeat Region, pop-up repeat Region dialog box, because to page display, so choose each show a few, Here I entered is 10, meaning for each page to display 10 records, you can freely enter according to the situation, as shown in Figure 17. Click the OK button to return to the page.

Figure 17
6, because it is pagination display, need to page, then in DW how to achieve it? Very simple, we first select "Home", and then click on the application panel of the server behaviors tag, press the plus button, you can see a recordset paging option, slide the mouse to this option, display a drop-down menu, The meaning of these menus I think you should understand it, as shown in Figure 18. Select the first "Move to", pop-up dialog box, as shown in Figure 19, click OK button back to the page, so "home" dynamic link is done, the other "prev", "Next", "last" and so on, and so on with its corresponding dynamic link.

Figure 18

Figure 19
7, then how do users know that the record has been to the last one, and should not be further down? Here, I was resolved, if the record has been to the last, then "Next", "last" on the page automatically hidden, similarly, the record has been to the first, then "first page", "prev" Automatically hidden. The following are the implementation methods:
(1) We first select "Home", then click on the application panel of the server behaviors tag, press the plus button, slide the mouse to show region options, showing the Drop-down menu, as shown in Figure 20.

Figure 20
(2) Select "Show Region if not", meaning that if not the first record is displayed, the other way is if the first record is not displayed, hidden.
(3) In the pop-up dialog box directly click on the OK button back to the page, so "home" automatic hiding function is done.
(4) The same, do a few other automatic hiding function. "Previous" and "Home", select "Show Region if not", "Next" and "Last", select "Show Region if not".
At this point, by Category query Display page finally finished production, we look at the specific effect. Run PWS, with IE open chaxun.asp, click on a certain category name, such as "new drugs", ie will automatically show the category of books, click "Next", "Prev" and so on links to see whether IE will automatically turn the page, the specific effect of Figure 21, 22.

Figure 21

Figure 22
   Four,Make a Web page that is queried by the name of the book
1, a new Dynamic Web page, named Chaxun1.asp.
2, the input of static content on the Web page, as shown in Figure 23, where "back" link to the home page index.htm, red dotted line indicates that this is a form, the form's property settings as shown in Figure 24, Post (pass) a form variable name to the Xianshi1.asp Web page, and execute the page so that the query page and the display page are connected by the variable name; the text box is named TS, remember, because this is the name of the variable to pass through the form, and then the Display page will be used.

Figure 23

Figure 24
   Five,Make a Web page that is displayed by book name
1, a new Dynamic Web page, named Xianshi1.asp.
2, input Web page static display content, such as Figure 25, where "back" link to query page chaxun1.htm, red dotted line also indicates that this is a form.

Figure 25
3, set up a recordset. Select the Bindings tab in the Application panel, press the plus button, select the recordset (Query), eject the recordset dialog box, the settings in Figure 26, name Recordset1, database table Select Tushu, Filter filter condition is set to the field "book title" in Table Tushu to contains (contains) the form Variable (form variable) TS, which is the name of the text box in the query page chaxun1.asp. Click the OK button to return to the page.

Figure 26
4. Drag the recordset's fields to the appropriate location on the page, respectively.
5, select the second line of the table, click on the application panel in the server behaviors tag, press the plus button, select Repeat Region, pop-up repeat Region dialog box, set to show all.
The final page effect is shown in Figure 27.

Figure 27
At this point, according to the Book Name query Display page finally finished production, we look at the specific effect. Run PWS, use IE to open chaxun1.asp, enter a name, such as "Quality management", IE will automatically show all titles contain "Quality Management" books, the specific effect of Figure 28, 29.

Figure 28

Figure 29
Web page finally all finished, now we can complete the operation. The IP address of their own computer to tell colleagues, open PWS, so that colleagues can query the system at any time to query the book.

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.