Dreamweaver build Blog (8): Administrator page implementation

Source: Internet
Author: User
Tags add copy insert first row visibility window dreamweaver
dreamweaver| Admin | page so far, doking ' s blog basic functionality has been achieved. But the administrator of the supremacy of "life and Death power", strict management of users to publish notes and replies, to prevent users in the doking ' s blog published there are harmful information.

8.1 Implementation of Administrator login

(1) Create a new blank aps.net VB dynamic page gllogin.aspx, insert the form glfrm, and then insert the table, set as shown in Figure 8-1.

Figure 8-1 Gllogin Page Design

(2) The ID of the corresponding text box for the administrator is gly, and the ID of the corresponding text box for the password is glpass.

(3) Add the dataset gly, set to filter, as shown in Figure 8-2.

Figure 8-2 Adding data set gly

(4) Click on "Advanced" button, add parameter @glpass, as shown in Figure 8-3.

Figure 8-3 Adding a parameter @glpass

(5) in the DataSet Gly Advanced dialog box, change the SQL command as shown in Figure 8-4.

Figure 8-4 DataSet gly Advanced dialog box

(6) Switch to Code view and insert the code shown in Figure 8-5 before the

Figure 8-5 Inserting code before

(7) Save gllogin.aspx.

8.2 Learning Note Management

From the previous section, you can see the administrator login successful, link to doking ' s blog home page, to learn notes to manage. In previous chapters, however, Index.aspx did not remove the ability to learn notes. This section will add this functionality to it.

(1) In the first row of table Ztre, insert the ASP label Label1, the text is: Delete, as shown in Figure 8-6.

Figure 8-6 Inserting an ASP label Label1

(2) Right-click the ASP tag Label1, select "Edit Tag" under the shortcut menu, select "Style Information", set to not visible, as shown in Figure 8-7.

Figure 8-7 Setting the ASP label Label1 is not visible

(3) Insert the check box under the form control, name Ztid, insert the button under the form control, the ID is gly, and the result is shown in Figure 8-8.

Figure 8-8 setting in table Ztre

(4) Switch to the Properties tab under the Tags panel, expand the General item, and click Dynamic Data in the "value" item, as shown in Figure 8-9.

Figure 8-9 Ztid Tag Properties panel

(5) In the Pop-up Dynamic Data dialog box, select the field in the DataSet Ztre Ztid and press OK, as shown in Figure 8-10.

Figure 8-10 Dynamic Data window
(6) Right-click on the status bar to select <input#ZIID> Open the Quick Edit tab window, add code to its label:

style= "Visibility: <%# IIF (Session (" gly ") <>nothing," visible "," hidden ")%>" value= "<%# Ztre.fieldvalue ("Ztid", Container)%> "

As shown in the dark blue figure 8-11.

Figure 8-11 Quick Edit <input#ZIID> Label

(7) Select the button gly, right-click the status bar to select <input#GLY> Open the Quick Edit tab window, add code to its label:

style= "Visibility: <%# IIF (Session (" gly ") <>nothing," visible "," hidden ")%>" value= "<%# Ztre.fieldvalue ("Ztid", Container)%> "

(8) Add the "delete record" server behavior, which is set as shown in Figure 8-12.

Figure 8-12 Adding the Delete record server behavior

(9) Press "OK" key to complete add "Delete record" server behavior. Switch to Code view to find the original code for the "delete record" server behavior, as shown in the red circle in Figure 8-13.

Figure 8-13 The original code for the "delete record" server behavior

(10) Delete the code in lines 5, 8, 12, 13, 14, as shown in Figure 8-2-8, and change the value of debug in line 10th to false to add a new behavior: id= "Del1", as shown in Figure 8-14 red circle.

Figure 8-14 Original code for "Delete record" Del1 Server behavior after modification

(11) Copy the code shown in the red circle of the 8-2-9, that is, copy the modified "delete record" Del1 the server behavior of the original code, paste it to the appropriate location, change the ID to "Del2", as shown in Figure 8-15.

Figure 8-15 Adding Del2 "Delete Record" server behavior

(12) Insert the code shown in the red circle in Figure 8-16 in the page load triggered event Page_Load.

Figure 8-16 Code inserted in the page load triggered event Page_Load

8.3 Note Reply Management

Note-back management is consistent with the principles and methods of learning note management.

(1) Open index.aspx, copy ASP label Label1, form control Ztid and button GLG, open hf.aspx, paste the three controls into the position shown in Figure 8-17, and change the ID of the form control Ztid to Hfid.

Figure 8-17 Paste control to Hf.aspx

(2) Select the check box hfid, switch to the Properties tab under the Tags panel, expand the General item, click Dynamic Data in the "value" item, and in the Dynamic Data dialog box that pops up, select the field Hfid under the DataSet Hfre, and press OK, as shown in Figure 8-18.

Figure 8-18 Dynamic Data window

(3) Copy the "Del1" in index.aspx to delete the original code of the record service behavior and paste it into the hf.aspx.

(4) Load the trigger event on the page in the Hf.aspx page Page_Load insert the code shown in the red circle in Figure 8-19.

Figure 8-19 Load trigger event Page_Load Insert code for H page

(5) Find the original code of the form YHPLFRM, and move it to the table Ztre label before the result is shown in Figure 8-20.

Figure 8-20 Label for moving form Yhplfrm

(6) Insert the code shown in the red circle of Figure 8-21 before the table hftab the label.

Figure 8-21 inserting code before the table Hftab tag

(7) After the form YHPLFRM end tag </form> move to the form Ztre label, insert the code shown in the red circle in Figure 8-22 after the table Hftab tag.

Figure 8-22 inserting code after the table Hftab tag

Reminder: There is also a problem with an admin exit login.



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.