Dreamweaver MX 2004 Design Message This combat (3)

Source: Internet
Author: User
Tags add date define empty string sort time and date dreamweaver
dreamweaver| Design Press CTRL+F9 to expand the server Behavior panel, see the top three of those four before there is a tick, if not the corresponding items in the definition site is not set up, redo the site definition of DW, and then start to create a recordset, there are three ways:

1 Click the + number on the server behavior panel

2 insert>>application objects>>recordset on the Insert menu


3 Click the first icon in the Application tool Group:

Since we have not yet connected to the database, we now need to define the connection database string. In the pop-up Recordset dialog box, click the define shown in Figure 45 ... button, and then click the New button in the Connectionsforsite Guestbook dialog box to select Customconnectionstring in the Drop-down option that appears

Now is the most critical step, fill out the custom string in the custom Connection String dialog box:

Connection name one fill: Conn

ConnectionString one entry (note with double quotes): Provider=microsoft.jet.oledb.4.0;datasource=&server.mappath (/guestbook/ Data.mdb)

And then select the using driver on testing server

: 1

After that all the way, OK or done, go back to the recordset dialog shown in Figure 44 and fill out the following:

Name (recordset name): RS

Connection (connection): Conn

Table (Tables): Main

Columns (field): First select selected and then hold down SHIFT or CTRL to select all fields except ID

Sort (sort): choose to sort by descending (in descending order) of the contents of the data field

When you are sure, a prompt appears, presumably meaning that the recordset has been added to the page, that you can access the fields of the recordset in the Bindings panel, select Dont Showmeagain, and then press OK

We associate the avatar address with the data in the database to think, that is, binding icon field data to the picture address:

1 Select the Avatar Picture and click the icon in the Properties panel as shown in Figure 48

2 The Select File Namefrom item selected in the pop-up Select Image Source dialog box DataSources switch to the Choose Picture Source mode from the data source (Figure 49)

3 First cut the contents of the URL that column, and then click the Icon field, and then the contents of the paste back, modified into figure 50 as shown

: 2

This completes the avatar's binding and controls the path of the image before and after the binding. Are you starting to feel a little bit interesting? OK, do not stop, and continue to bind the Name field to the guest nickname under Avatar:

1) Select the guest nickname four words and press CTRL+F10 to expand bindings (binding) panel

2 Select the Name field from and click the Insert button below (Figure 51)

3 then in the Name field on the right side of the formatted inverted triangle, click to select Encode-server.htmlencode

In the same vein, bind the Name field to visitors posted in 2003-9-274:04:49, date field bindings time and date published in 2003-9-274:04:49, content bound to message content, reply binding to reply content, Soft return to bind rdate field after replying content:

Take a closer look, as if there is a home page, mailbox and QQ unbound data. According to our plan, these three groups of text should all be linked, and the link address with the visitor input data binding, in fact, this is similar to the method of binding head:

1 Select the Home page and click the Browse Forfile button in the Properties panel, selectfile the pop-up dialog box as shown in Figure 54, and finally go back to the Properties panel and select target value as _blank to open the guest page in a new window

2 the same abbreviation for the link of the letter box, slightly different is the link front of the mailbox need to add mailto:, as shown in Figure 55

3 the link to do QQ and the previous slightly different, because we look at the QQ user's data address is http://search.tencent.com/cgi-bin/friend/user_show_info?ln=******, So what we're going to do is replace the asterisk with the QQ field data, as shown in Figure 56

: 3



Now all the data is bound, but don't be too happy, such a message board will always display a message record, so we also need to set the repeating field and page

1 The cursor is positioned in the cell where the avatar is located, and then click in Table Two, as shown in Figure 57

2) Press CTRL+F9 to expand the Server Behavior panel, click the + button, select Repeatregion in the Drop-down menu that appears, or the fourth icon in the Application tool group, and then pop up the repeatregion dialog box, with the default settings, So just point "OK"

3 Select Form Two and then apply the server behavior show Region if the If Recordset is not Empty, as shown in Figure 58

This is to not go wrong when the database is not logged, and I believe in Figure 58 you have noticed the first show Region if Recordsetisempty, which can set what is displayed when the database is not logged. The data record is many after certainly cannot all let them appear on one page, therefore we also need to give the display message to add the paging function. Select the first page, press CTRL+F9 to expand the Server Behavior panel, click the + number above, select Recordsetpaging>>moveto Firstrecordset in the Pull-down menu (Figure 59), and give the page, the next page, and the end pages the function of paging, The corresponding server behavior is the movetoprevious recordset, move to Next Recordset, and move Tolastrecordset, by the way, these server behaviors can also be found in the Application tool group. And there is a direct insert Recordsetnavigationbar (navigation bar), you can try to do with what we have just done the difference. Finally remember to also apply show regionif recordsetis not empty command to the navigation bar, and paging without a record is unnecessary.

: 4



Do here, our home page is finally finished, you can at ease, in IE input http://localhost/guestbook see labor results ... What the? There's nothing?

Of course, because our database is not yet recorded, if you want to look at the effect can open the database with access to add records directly.

Save the index.asp as a insert.asp, modify the title of the page to fill in the message, delete some forms, and in the server panel in addition to the first Recordset (RS) behavior is selected after the above-number delete, after the completion of this is probably the case:

The cursor is positioned to the cell in the third row. Application The record Insertionformwizard icon in the tool group (Figure 63), pops up the Recordinsertionform dialog box, deletes some items, and sets the following ( Property items that are not written are all in default values):

Connection:conninsert into Table:mainafterinserting,goto:index.aspnamelabel: Nickname: Emaillabel: Email: HomepageLabel: Home: D Efaultvalue:http://qqsubmitas:numericcontentlabel: Content: Display as:textareaicondisplay as:hiddenfielddefault value:0 1IPDisplay as:hiddenfielddefaultvalue:<%= Request.ServerVariables (REMOTE_ADDR)%>:5

In addition to the above mentioned above, the other items are deleted by the above number, and the order of the upper triangle and the following adjustments are completed, as shown in the picture.

To add a message to the page in the function has been completed, the following is my adjustment of the position of the table items and CSS on the text box to beautify the effect:

Set the ID of the cell that contains the avatar image to icon (add Id=icon to the cell TD tag) and add the following code to the Css.css file:

Input,textareafont-family:verdana, XXFarEastFont-font-size:12px;background-color: #DDDDDD; border=1 height:18px;width:150px; border:1px Solid#333333;extareaborder=1height:120px;width:98%;overflow:hidden; #iconimgmargin: 2px;cursor:hand;:6

If you do not need a table item to change the background color when the mouse event occurs, you can remove the function ① and ②, if the handwriting form verification code too tired, you can remove the function ④, and then to yaromat.com download a call Checkform plug-in, could not find words from this address: http:// Vip.5d.cn/xmercy/form/checkform.mxp. Plug-in download after double click Automatic installation, the last in the behavior panel + number, select Yaromat>>checkform can be used, the use of plug-ins is very simple, here will not say more.

Warning when filling in incorrectly

: 7

If the submission is 500 errors after the correct completion, it is possible that everyone has too low permission to operate the database:

1 Right click on the database file and select Properties on the shortcut menu

2 Switch to the Security tab, set the following

If there is an error and you have confirmed that all of the previous actions are correct, press CTRL + ' switch to Source view and check to see if there is a <% @LANGUAGE =vbscript codepage=936%> and a <% in your code @LANGUAGE =vbscript%&gt, some words delete <% @LANGUAGE =vbscript%>.


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.