Monday, October 12, 2009

Dreamweaver compose builds memoir of Blog whole journey (the implementation of 5)- cent column and reply

Menu of note of the 5th chapter divides the implementation of column and reply

The home page that those who finish is in in the 4th chapter actually very not perfect, it is note menu cent column does not have a link, cannot click; 2 it is to click note to inscribe mark, cannot link reply page; 3 it is to click an author, cannot link the author's information. Lieutenant general of this one chapter can perfect these functions.

5.1 Note menu divides column implementation

Design train of thought: The menu in Bkblog.dwt.aspx of modification pattern plate divides the super link of column, update all webpages then; When opening home page, browse fall by time the content that order pattern shows to institute study takes notes, click menu to divide column, can undertake according to dividing column order pattern classifies content of indication study note falling by time again.

   5.1.1 build pattern plate menu

(1) open pattern plate Bkblog.dwt.aspx, choose dynamic text version (Menuda.LM) , establish super link, catenary receives home page (Index.aspx) , choice [code shows view] , move the mouse to the place of the gules perpendicular that shows like graph 5-1-1 place. (below all without special specification symbol is English character)

Graph 5-1-1 The mouse moves come to link attribute

(2) input " ? Menanw= " (Menanw is parameter is variable) , switch arrives [bind calm] face plate, dilatory data set (Menuda) the field LMID below arrives to be equal to date to what a moment ago inputted from the back, the result shows like graph 5-1-2 place:

Graph 5-1-2 inserts dynamic attribute (A.href)

(3) switch arrives [server behavior] face plate, can look to had increased action of a server: Dynamic attribute (A.href) , if graph 5-1-3 place shows:

Face plate of behavior of graph 5-1-3 server

(4) choose " homepage " menu, found catenary to receive Index.aspx; Choice " contact us " , found catenary to receive Mailto:wEn110@21cn.com.

(5) save Bkblog.dwt.aspx pattern plate, can shoot a dialog box that shows like graph 5-1-4 place at this moment.

Graph 5-1-4 Update dialog box of pattern plate file.

(6) click " update " pushbutton, menu of the note that finish divides column, update home page Index.aspx.

   5.1.2 In home page implementation divides column to show

(1) open home page Index.aspx, switch arrives [server behavior] face plate, doubleclick data set (Ztre) , in shooting the data set dialog box that give, click " advanced " pushbutton, if pursue,5-1-5 place is shown. Choice [SQL] the SQL command in text area undertakes duplicating, proposal it stickup in building newly-built notebook or Word text version, after it is in, measure lieutenant general can have very big effect (familiar SQL language, can jump over this measure) .

Graph 5-1-5 Data set is advanced dialog box

(2) click " simple " pushbutton, in [choose] next choices in pulling menu choose a field to be LMID, anthology " URL parameter " transfer pattern as parameter, input parameter variable is Menanw, press " affirmatory " key, the result shows like graph 5-1-6 place:

Graph 5-1-6 Modification Ztre data set is choose

(3) undertake to home page IE is browsed, the result that browse does not have a record, if graph 5-1-7 place is shown

Graph 5-1-7 Home page browses a graph

(4) browse in home page IE in, click a link " network process designing " , the graph 4-3-3 place of chapter of result as above is shown, the study that shows all network process designing takes notes.

"Etc, this and former design train of thought are not accorded with! Press minute of column to show only, cannot show all study take notes! " the problem that here still has a data between ASP.NET page to deliver: It is OK that the data between the body of each Form window in Windows application process is delivered through defining global variable (Public Static is variable) wait for a method to come true. And these methods however cannot data of each Web page is delivered in ASP.NET of in order to. For example: Should click data set navigation the data that can have a Ztre_currentPage is delivered, cannot transmit the data of Menanw however, should click data set navigation that is to say any is super link, the data that Menan transmits is empty value forever, this cannot realize minute of column to show already, undertake the page shows is in separating the branch below column at the same time again. Here is to adopt the method that Session has parameter is delivered to solve.

(5) give Session("menanw") to deliver parameter variable Menanw, switch arrives code view, before <html> label, insert the code that in be being encircled like graph 5-1-8 red, shows.

Graph 5-1-8 Insert a page to be record in acquiescent function to Index.aspx

(6) be in [server behavior] data set of the choice in face plate (Ztre) , if graph 5-1-9 place is shown, those who take black part is data set (Ztre) definition code.

Graph 5-1-9 The code of data set Ztre

(7) find code:

CommandText='<%# "SELECT * FROM ZTRE WHERE LMID = ? ORDER BY ZITIME ASC" %>'

the code instead above:

CommandText='<%# IIf(((request.QueryString("menanw")<>nothing) Or Request.QueryString("Ztre_CurrentPage") <>Nothing) , "SELECT * FROM ZTRE WHERE LMID = ? ORDER BY ZITIME DESC" , "SELECT * FROM ZTRE ORDER BY ZITIME DESC") %>'

(8) find code:

<Parameter Name="@LMID " Value='<%# IIf((request.QueryString("menanw") <>Nothing) , request.QueryString("menanw") , "") %>' Type="Integer "  / > </Parameters></MM:DAtaSet>

the code instead above:

<Parameter Name="@LMID " Value='<%# IIf((session("menanw") <>Nothing) , session("menanw") , "") %>' Type="Integer "  / > </Parameters></MM:DAtaSet>

(9) undertake IE is browsed, as a result the graph 4-3-3 place of the 4th chapter is shown. Finish established design train of thought.

  

5.2 The implementation of reply page

Design train of thought: Can realize the caption that clicks note, can link quite give a page, include this note and corresponding and all return. From on one, can this is not difficult already, parameter delivered the code that this note has on the super link in note caption only to be able to come true.

   5.2.1 Basic page is designed

(1) build the Hf.aspx of ASP.NET VB dynamic page that generates by pattern plate Bkblog.dwt.aspx, the area can edit to insert form Ztre inside the country in Mainbody, hand-in-hand travel concerns a design, the result shows like graph 5-2-1 place:

Blueprint of Ztre of graph 5-2-1 form

(2) the Access2003 that start, build FH watch, YH to express join to inquire HFRE, if graph 5-2-2 place is shown,actually join view reachs indication field.

Graph 5-2-2 Inquire the concerned design of HFRE

(3) press 4.2.2 data set the section is then medium (1) - (3) measure, add data set Ztre, dilatory field arrives corresponding position, text version of hand-in-hand action form (Ztre.ZYTEXT) format setting, the result shows like graph 5-2-3 place:

Graph 5-2-3 Bind destiny to occupy form Ztre

(4) Ztre of modification data set is choose, choose a field to be ZTID, anthology " URL parameter " transfer pattern as parameter, input parameter variable is Ztanw.

(5) add data set Hfre, choose a field to be ZTID, anthology " URL parameter " transfer pattern as parameter, input parameter variable is Ztanw, the result shows like graph 5-2-4 place:

Graph 5-2-4 The design of data set Hfre

(6) field of Hfre of dilatory data set arrives the corresponding position of form Ztre, set dynamic text (Htre.HFTEXT) the format is installed " encode, HTML encode format " , form Ztre the 5th, 6, 7, the definition is repeat area, definition data distributes a page to form Ztre, the result shows like graph 5-2-5 place:

Graph 5-2-5 Bind destiny to arrive according to collect Htre in form Ztre

(7) open home page Index.aspx, choose dynamic text version (Ztre.ZTNAME) , establish super link, catenary receives Hf.aspx, switch arrives code view, link attribute instead: Hf.aspx? Ztanw= , the field ZTID below Ztre of dilatory data set arrives after be equal to date, the result shows like graph 5-2-6 place:

Graph 5-2-6 adds dynamic and super link in code

(8) save Hf.aspx and Index.asps, corresponding HF watch, YH watch gives to input a few records casually in Access, make Index.asps is browsed in IE browser, point out the study note theme that has a return, if graph 5-2-7 place shows:

Graph 5-2-7 The indication of reply page

(9) the any that clicks data set navigation again is super link, the result shows like graph 5-2-8 place:

Graph 5-2-8 Click result of the page after data set navigation

Ah! Did not have completely! This counts the issue that gives as it is said between ASP.NET webpage namely. In must resembling 5.1, that undertakes modification.

(10) switch arrives code view, before <html> label, insert the code that in be being encircled like graph 5-2-9 red, shows.

Graph 5-2-9 Insert a page to be record in acquiescent function to Hf.aspx

(11) the code in finding data set Ztre:

 <Parameter Name="@ZTID " Value='<%# IIf((request.QueryString("ztanw") <>Nothing) , request.QueryString("ztanw") , "") %>' Type="Integer "  / > 

Above the Request.QueryString("ztanw") in code is replaced for Session("ztanw") , result code repairs instead

<Parameter Name="@ZTID " Value='<%# IIf((session("ztanw")<>Nothing) , session("ztanw") , "") %>' Type="Integer "  / >

(12) the code in finding data set Hfre:

 <Parameter Name="@ZTID " Value='<%# IIf((request.QueryString("ztanw") <>Nothing) , request.QueryString("ztanw") , "") %>' Type="Integer "  / > 

Above the Request.QueryString("ztanw") in code is replaced for Session("ztanw") , result code repairs instead

<Parameter Name="@ZTID " Value='<%# IIf((session("ztanw")<>Nothing) , session("ztanw") , "") %>' Type="Integer "  / >

(13) save Hf.aspx.

  

No comments:

Post a Comment