Dreamweaver build Web Query System (3)

Source: Internet
Author: User
Tags modify query dreamweaver
dreamweaver|web| Query System

Second, convert the index.asp into a dynamic page

Starting with this section, we will gradually convert the static page that we created earlier into a dynamic page that combines it with the database to complete our final page.
First we need to convert the homepage to a dynamic page. On the home page, only the "Value Recommendation" section on the right side needs to read the data from the database, so our goal is to read the records from the Tele table in the database with a Is_good field value of 1 and show it in descending order.
OK, get to work. Step 1th, set up the dataset. In the Bindings panel, select the Recordset (query) menu and in the dialog box as shown in Figure 6-5


( large picture please enlarge and view )

Select the appropriate content. Now that the dataset is set up, the bindings panel already shows the fields of the datasheet. In step 2nd, drag the company name onto the page to display the field contents in the page. Refer to Figure 6-6:

So far, we've shown a record in our database on a Web page, but our goal is not to display a single record, but to display 10 records. Therefore, we also construct a repeat region behavior that will only be able to display the number of records we specify in the Web page. To construct a repeat region behavior, select Repeat region in the server Behaviors panel and, based on figure 6-7, note that you must select the table row you want to set when you select the repeat region behavior, which is the <tr> part of HTML.

Finally, we set up but click on an enterprise should display a detailed page of the connection, that is, call disp_tele.asp display phone number corresponding to the enterprise or individual details, where we are passed through the form of ID parameters to the disp_tele.asp page. Select the dynamic text on the page and enter the following in the Address bar: DISP_TELE.ASP?COMPANY_ID=<%=RS_CZTJ ("id")%>, as shown in Figure 6-8:



Iii. convert disp_tele.asp and right_114.asp to dynamic pages

God, I just got the news, November 5, the supply of heating, I still have a few days. Pain, Ah!
Today to talk about the construction of the disp_tele.asp page, the function of this page is to display detailed business or personal data. Page features are not very complicated, let's go!
Here, we first agree that the call format for this page is: "disp_tele.asp?company_id=&hy_id=" to display the phone number while displaying the details of the enterprise's industry-recommended enterprises. We do not need to Dreamweaver MX from the go to the detailed page behavior, we are manually fill in the code.
First, construct a recordset in the page to display the specified phone number for the enterprise details, note the URL parameter section, see Figure 6-9:

After the recordset is established, drag the field to the appropriate position in the page. To display the field contents.

Then, the recommended enterprise Recordset that corresponds to the construction of the relevant industry category. This section modifies the right_114.asp file because it is saved as a separate Web page. This step involves using the Advanced Recordset Definition dialog box and filling in some of the code manually. See Figure 6-10:

Drag the company name onto the page and create a repeat area behavior. Finally, manually modify the Dreamweaver MX generated code to have the value of the recommendation when no category parameters are displayed. Modify the content See Figure 6-11:


( large picture please enlarge and view )

Description, where the yellow part is the modified location.

OK, after the above modification, regardless of whether the call parameters are provided hy_id will display the corresponding super recommendation according to our intention. That is, if there are no parameters, all the recommendations (the first 10) will be displayed, and the first 10 of the corresponding categories, if available.
The end of this section is here to remind you that the Dreamweaver MX generated code is best studied. Do not expect Dreamweaver MX to automatically generate a website for you, you do not have to change a line. There's no such thing as that.



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.