Create a blog calendar event with Dreamweaver

Source: Internet
Author: User
Tags bind comments dreamweaver

This example to instance 93 will explain the BLOG implementation process through 3 examples. This example mainly explains the realization of BLOG calendar events.

Effect description

Figure 91-1 shows a preview of the BLOG "Index.aspx", which opens with the current system date essay and all comments on the essay. If you select a different date in the Calendar control, the essay for the appropriate date and all comments for that essay are displayed.

Creative Ideas

Adds a calendar control to the page, responds to the currently selected date with the Calendar control's "OnSelectionChanged" event, and displays the essay for that date and all comments for that essay.

Operation Steps

Step one BLOG basic environment settings and database

(1) Copy the instance 91 contents of the CD. Copy all the files in the "source instance 91" directory on the CD to the "C:inetpub Wwwrootblog" directory and set the home directory for the default Web site to "C:inetpubwwwrootblog" in the IIS server, and refer to the method in instance 1. New site "BLOG" in Dreamweaver, whose site directory is "C:inetpubwwwrootblog", by reference to instance 2.

(2) Open Bad.mdb with Access. Run Access, open "C:inetpubwwwrootblogdatad.mdb", and you can see 3 tables in the database "Bad.mdb" with "admin", "myblog" and "revert".

The admin table stores the user name and password for the blog, and its field settings are shown in Figure 91-2.

The "MyBlog" table is used to store essays published by the blog, and its field settings are shown in Figure 91-3.

The "revert" table is used to store replies from other users to essays published by a blog, and its field settings are shown in Figure 91-4.

(3) Establish the database connection "Blogconn", the Connection database is "c:inetpubwwwroot BLOG dat Ad.mdb", the method reference instance 75.

Step two Add a Calendar control

(1) Open "index.aspx" in Dreamweaver, as shown in Figure 91-5. Add a Calendar control to the position shown in the ① corner box in the figure, and ② the blog essay in the position shown in the Fillet box to bind to the date shown in the current calendar; bind all comments of the essay in the position shown in the ③ box in the figure, ④ the position in the fillet box to bind the control to the user to comment on the blog essay.

(2) Insert Calendar control "calendars". Move the mouse cursor over the ① round box shown in Figure 91-5, click the More Labels button on the asp.net shortcut menu, select the Asp:calendar service control in the WEB server control under ASP.net tab in the pop-up Tag Selector dialog box, and then Click the Insert button, as shown in Figure 91-6.

(3) Set the Calendar control. Set the associated style in the pop-up Tag Editor-calendar dialog box, as shown in Figure 91-7.

Tip: The general settings shown in Figure 91-7 should be set in the style in order for the calendar control to be more aesthetically pleasing.

(4) Close all pop-up dialog boxes, select the Calendar control, and in its label properties panel, set the DayNameFormat property under appearance to full, as shown in the rounded box in Figure 91-8.

(5) Save "index.aspx", and then browse the effect in IE, as shown in Figure 91-9.

(6) Adjust the display of the week. In Figure 91-9, you can see that the week's display is too long, if only show "day, one or two, three or four, five or six" words will be much simpler. To change the date display for the calendar, you need to set the Calendar control's "PreRender" event. You can perform any updates through the "PreRender" event before the server control renders to the page input. If you want to modify the default display for the week, you need to modify the thread's "DayNames" (that is, the full name of each day of the week) property.

First, add "system.globalization" to the page (classes that define culture-related information, including calendars) and "System.Threading" (which provides some classes and interfaces that can be multithreaded) two namespaces.

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.