Monday, October 12, 2009

Dreamweaver compose builds memoir of Blog whole journey (9)- site statistic

The 9th chapter The implementation of site statistic

At present till, doking's BLOG already can be run. But can discover left navigation or empty sky, below paragraphic and main add functional bill of fare for left navigation. This one chapter basically explains concerned site count is added on navigation to the left.

9.1 Basic page is designed

Open pattern plate Dkblog.dwt.aspx, the character is added to if graph 9-1 place is shown,be designed on navigation to the left.

Graph 9-1 Character of left navigation of pattern plate Dkblog.dwt.aspx is designed

9.2 Online number statistic

The implementation of online number statistic must rely on Global.asax file. Global.asax file included the program code of incident of administrative levels of processing application process, resemble the Global.asa file in classical ASP. The <script> label in Global.asax included face correspondence to use the incident processor of order administrative levels. The first group incident processor is in charge of handling those who use a program to begin and stop incident. When one begins incident to be able to be requested in any page first time, be waked up. And applied process stops incident to be met be waked up when applied process is shut.
Build Global.asax file, general and procurable make up. OK now Visual Web Developer 2005 builds Global.asax file quickly in this software.

(1) Visual Web Developer 2005 of download, installation.

Visual Web Developer 2005 downloads an address:

Http://go.microsoft.com/fwlink/ ? Linkid=30092&clcid=0x409

The installation after download, if graph 9-2 place is shown,its welcome an interface.

Graph 9-2 Visual Web Developer 2005 runs greeting interface

(2) after Visual Web Developer 2005 moves, choose [File] → [New File] , playing piece [New File] in the dialog box, spread out " Categories " " Web " option, choose " Visual Basic " , choose " Templates " medium " Global Application Class " , if pursue,9-3 place is shown.

Graph 9-3 New build Global Application Class

(3) click " Open " pushbutton, build if graph 9-4 place is shown,make a new Glbal file.

Graph 9-4 One builds newly-built Glbal file

(4) undertake modification to Glbal file, after revising, like graph 9-5 place is shown.

Graph 9-5 Modification Glbal file

(5) save Glbal file to arrive D:\Below Dkkblog root catalog, file name is Glbal.asax.

(6) in returning Dreamweaver, open pattern plate Dkblog.dwt.aspx, and switch becomes code view, find code:

<td Class="BTD"> stands originally online number statistic: Person </td>

And instead:

<td Class="BTD"> stands originally online number statistic: <%=Application("dk_uses")%>Person </td>

(7) save pattern plate.

Remind: Here builds Glball.asax file with Visual Web Developer 2005, for convenient reader, also let a reader contact Visual Web Developer 2005 at the same time, function of this new software is very powerful. If do not have Visual Web Developer 2005, can build a blank notebook directly, write the code that place of 9-5 of as above graph shows, it is good to save Glball.asax file.

9.3 The statistic that the site takes notes and replies

After-thought is in " 7.1 The user logs onto server behavior " in, its publish statistic of Ceng Wei user note and reply, the statistic that the site takes notes and replies and its kind with.

(1) open pattern plate Dkblog.dwt.aspx, build data set Zdbj, if graph 9-6 place is shown,its are installed; New build data set Zdhf, if graph 9-7 place is shown,its are installed.

Graph 9-6 The setting of data set Zdbj pursues

Graph 9-7 The setting of data set Zdhf pursues

(2) bind destiny to arrive according to Zbhf of collect Zbbj, data set in the page respectively, if pursue,9-8 place is shown.

Graph 9-8 Bind destiny to occupy collect Zbbj, Zbhf

(3) save pattern plate Dkblog.dwt.aspx, update all webpages.

No comments:

Post a Comment