Ultradev Example Tutorial: 5 make a relatively simple site backstage (2)

Source: Internet
Author: User
Tags add insert modify
Backstage | The first page of the tutorial is created, which is the latest updated 5 News records. Using the Ultradev we've learned to display records, it's easy for you to create a page with the following image:



How do i show the latest updated 5 records? Let's take a look at the dialog box that creates the recordset:



If we follow the usual method of creating a Recordset, the contents shown in the SQL bar above are:

Select Id,title,insert_time (we only need to display news headlines and record time, and news content does not need reality, so do not choose content this field)

From article

We modified her to the top. Top 5 means I only select 5 records, the ORDER by id desc means that when selecting records, the field is followed by the ID (desc for descending, and the ID is automatically numbered, which is the default is ascending), thus realizing the idea of the 5 records we are going to update.

When adding the repeat region behavior of server behaviors, select Show All records (since we only took 5 records). Careful friend at this time must also think of, ah, I can also through a page here to show how many records to realize how many records I want to go to the idea Ah! Yes, that's right, you can choose to display 5 records per page, which can also achieve the effect we want to achieve---but don't forget, order by ID Desc is essential ^_^

Then we then select {Recordset1.title} in the header cell and add a server behaviors----to Detail Page, as shown in figure:



Our goal is to pass an ID value to the detail.asp page so that it can correctly retrieve the records we want. After completing these, add a more connection and point to more.asp to show more news records.

The page effect is as shown in the figure:



In more.asp this page, we only need to simply change the first page just to be able to use. Open the dialog box that creates the recordset, remove the top 5 that we added (this will take out all the records in the database table), and then modify repeat region the number of bars displayed per page is 10, delete more connections, and insert-> Live Objects- >recordset nagavition Bar, so we can turn the page to show the news. Page as shown:



Next we will make the News detail page (ie detail.asp). As we mentioned above, the most important thing we have on the detail.asp page is to get the value from the previous page, which is id=x. As shown in figure:



Just down, make some forms, and drag the items that you created into the recordset into a row, as shown in figure:



Here we have the front part of the page is completed, the next step is the production of the background management page.

Originally, the correct order should be the first to make a good background management page, to be able to correctly add, delete, edit the data when the front page of the production. Because after all, the front page does just the data display, if even the data can not be added, then you do a good job at the front desk is no use, and if the production of the background management page can not be too much to pursue the beautiful page, once the error to be modified also quickly, unlike the foreground, once the page design is good, It's hard to change (although Ultradev has made the job relatively easy, but it's still a problem). However, because our pages are simpler, the data structure is simple, there is no error, so we do not emphasize this point. But friends do in the future when it is best to follow the backstage-〉 in order to do better.
the fifth chapter: makes a relatively simple website backstage (2)

The admin page can be divided into three parts:


Data Add

data editing, deletion

Login Verification

Let's start with the data additions. As we know from the previous study, it is easy to make a page in the Ultradev to add a data, just Insert-> Live Objects-> Recordset insertion form. As shown in the picture, the page adding the news, add the administrator user is similar, do not say more:



After the creation is complete, as shown in figure:



This is the page to add a new user:


Open the browser to see the effect:



But our problem is here. When you add late data, open the corresponding details page from the homepage, at this time you will see just added when the paragraph also clear the data is now crowded into a group. The original section has not been dropped!



All users using Ultradev software must have met the text on the ASP page from the database to squeeze into a group of the phenomenon, initially entered the space and the line is not. Because there is no processing of spaces and wrapping in the database at all in ASP statements. Of course, the user who has studied ASP programming can join the code to transform the space and line in the database to become the HTML code, or you can change the space and the line into HTML code before the text is submitted to the database and then output. However, no matter which way the user has not studied the ASP is undoubtedly a nightmare. Even if you learn to convert that also need to manually modify the source code in each ASP page, both time-consuming and laborious, for a long time there is no very convenient solution.

What to do? Oh, no hurry, here will use the plug-in function we talked about before.

Here we are going to use a plugin---spdesign format to help us implement a feature (click here to download the plugin).
Next I recommend a solution to this problem Ultradev Plug-ins: The use of the method is very simple, just select Dynamic Data after the application of the plug-in command to complete the space and newline formatting.

After installing the plugin as shown



How to apply this plugin? Very simple, see the figure below, is not at a glance? *_"



After the application of Plug-ins, and then look at our page, ah, is not the effect you want?



Adding a record page is relatively simple, and if you read what we said earlier and practiced it, I believe you'll be able to do it soon.  Ok, next, we're going to talk about the editing and deletion of the records. We have analyzed before, to record the editing and deletion, in fact, is to pass a value from one page to another page, and then take another page based on the passing value of the past to remove the corresponding unique record to exert edit, delete behavior. So, first we have to make a page that is used as a passing value. This page is very simple, in fact, is a data display page, but added two connections: Modify Delete To select the two connections, apply the Detail page behavior in server bahaviors: Change_article.asp and DEL_ respectively Article.asp two pages (here we use the edit, delete news as an example, the user's management is the same)





The final page looks like this:



To display an effect in a browser:




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.