The 8th chapter The implementation of administrator page
At present till, doking's BLOG basic skill can have come true. But the administrator is sovereign " authority of life and death " , severity manages the note that the user publishs and return, prevent an user to be published in Doking's BLOG have harm sex news.
8.1 The implementation that the administrator logs onto
(1) build Gllogin.aspx of dynamic page of blank APS.NET VB, insert the Glfrm that express sheet, insert form again, if graph 8-1 place is shown,install.
Graph 8-1 The page of Gllogin is designed
(2) the ID that sets the text draw a frame round with corresponding administrator is GLY, the ID of the text casing of password correspondence is GLPASS.
(3) add data set Gly, set to choose, if pursue,8-2 place is shown.
Graph 8-2 Add data set Gly
(4) click " advanced " pushbutton, add parameter @GLPASS, if pursue,8-3 place is shown.
Graph 8-3 Add parameter @GLPASS
(5) in advanced dialog box of data set Gly, if graph 8-4 place is shown,command SQL instead.
Graph 8-4 Advanced dialog box of data set Gly
(6) switch arrives code view, before <html> label, insert the code that shows like graph 8-5 place.
Graph 8-5 Code is inserted before <html> label
(7) save Gllogin.aspx.
8.2 Learn note management
From go up in the section, after can seeing the administrator logs onto a success, catenary receives Doking ' the home page of S BLOG, undertake administrative to learning note. But paragraphic before in, index.aspx did not delete the function that learns note. This one section general adds this one function for it.
(1) in the group in form Ztre, insert Asp label Label1, text is: Delete, if pursue,8-6 place is shown.
Graph 8-6 Insert Asp label Label1
(2) Label1 of label of Asp of right key choice, choose quick menu to fall " editor label " , choose " modal information " , set for sightless, if pursue,8-7 place is shown.
Graph 8-7 Set Asp label Label1 to be sightless
(3) insert watch sheet to accuse below answer choose casing, name for ZTID, insert watch sheet to accuse a pushbutton below, ID is GLY, if pursue,as a result 8-8 place is shown.
Graph 8-8 In the setting of form Ztre
(4) switch arrives [label] below face plate [attribute] option gets stuck, spread out " groovy " , in " Value " in click dynamic data, if pursue,8-9 place is shown.
Graph 8-9 Face plate of ZTID label attribute
(5) playing go out " dynamic data " in the dialog box, choose the field ZTID below data set Ztre, press " affirmatory " key, if pursue,8-10 place is shown.
Graph 8-10 Dynamic data window
(6) <input#ZIID> of choice of right below condition column key opens window of fast editor label, code adds in its label:
Style="visibility: <%# Iif(session("GLY")<>nothing, "Visible" , "Hidden")%>" Value="<%# Ztre.FieldValue("ZTID" , container) %> "
If graph 8-11 is blue-black,be shown.
Graph 8-11 Edit <input#ZIID> label quickly
(7) choice pushbutton GLY, right below condition column key chooses <input#GLY> to open window of fast editor label, code adds in its label:
Style="visibility: <%# Iif(session("GLY")<>nothing, "Visible" , "Hidden")%>" Value="<%# Ztre.FieldValue("ZTID" , container) %> "
(8) add " delete a record " server behavior, if graph 8-12 place is shown,its are installed.
Graph 8-12 Add " delete a record " server behavior
(9) press " affirmatory " key, finish add " delete a record " server behavior. Switch finds this to code view " delete a record " the former code of server behavior, if graph 8-13 is gules,the place in the circle is shown.
Graph 8-13 "Delete a record " the former code of server behavior
(10) what in deleting the 8-2-8 that be like a graph, show 5, 8, 12, 13, 14 code, the False of value True instead of the 10th Debug in travel, add new act: Id= " Del1 " , the place in after revising, be being encircled like graph 8-14 red is shown.
Graph 8-14 After revising " delete a record " the former code of Del1 server behavior
(11) the code that duplicate graph 8-2-9 shows in red circle, duplicate namely after revising " delete a record " the former code of Del1 server behavior, it stickup to proper place, change Id to be " Del2 " , if pursue,8-15 place is shown.
Graph 8-15 Add Del2 " delete a record " server behavior
(12) the code that is record in the place in red of the 8-16 that be like a graph is being inserted to encircle in the incident Page_load that spark to show in the page.
Graph 8-16 The code that inserts in the incident Page_load that spark loads in the page
8.3 Note reply manages
Note reply management and the truth that learn note management and method are consistent.
(1) open Index.aspx, sheet of Label1 of duplicate Asp label, watch accuses a ZTID and pushbutton GLG, open Hf.aspx, accuse these 3 stickup the position that shows to place of the 8-17 that be like a graph, the ID instead HFID that expresses sheet to accuse a ZTID.
Graph 8-17 To Hf.aspx stickup accuse
(2) choice answer chooses casing HFID, switch arrives [label] below face plate [attribute] option gets stuck, spread out " groovy " , in " Value " in click dynamic data, playing go out " dynamic data " in the dialog box, choose the field HFID below data set Hfre, press " affirmatory " key, if pursue,8-18 place is shown.
Graph 8-18 Dynamic data window
(3) in duplicate Index.aspx " Del1 " the former code that deletes a record to serve behavior, stickup in Hf.aspx.
(4) the page in giving Hf.aspx the page loads spark if graph 8-19 is gules,incident Page_load is inserted the code that shows in the circle.
Graph 8-19 Load to H page spark incident Page_load inserts code
(5) the former code that finds the Yhplfrm that express sheet, move its before form Ztre label, if pursue,as a result 8-20 place is shown.
Graph 8-20 Shift expresses the label of odd Yhplfrm
(6) the code that if graph 8-21 red encircles place to show,inserts before form Hftab label.
Graph 8-21 Code is inserted before form Hftab label
(7) the Yhplfrm that express sheet end label </form> moves after form Ztre label, if graph 8-22 red encircles shows code,insert after form Hftab label.
Graph 8-22 Code is inserted after form Hftab label
Remind: Here still has an administrator to exit entry problem, that leaves a reader to move think. Hint, want to set onlySession(" GLY " )It is OK to be empty value or empty string.

No comments:
Post a Comment