Friday, October 9, 2009

Ultradev example tutorial: 5Become a relatively simple website backstage supporter (2)

Found home page above all, it is actual and newest updated 5 news record. The Ultradev that uses us to acquire displays the function of the record, very easy the page that you can have established following plans:



How to show newest 5 updated records? Let us see the dialog box that founds record volume:



If us according to the method that establishs record volume commonly, going up the content that the graph shows in medium SQL column can be:

SELECT ID, title, insert_time (the caption that we need to show news only and clock, and news content does not need realism, need not choose Content so this field)

FROM Article

We modify her the manner above. Top 5 states I choose 5 records only, and when ORDER BY ID DESC expresses to choose a record, be according to ID this field from hind take forth (DESC expresses to fall foreword, and ID this field is automatic number, acquiescing namely is ascend) , came true so we should go newest the idea of 5 updated records.

When the Repeat Region behavior that adds Server Behaviors, the choice shows all records (because we were taken only,5 are recorded) . Attentive friend also thought of for certain at that time, alas, the one page that I also can carry here shows how many notes will realize the think of a way that I should go to how many recording! Yes, right, you can choose every page to show 5 records, also can achieve the result that we should achieve so---But did not forget, ORDER BY ID DESC is indispensable ^_^

Next the {RECORDSET1.title} in division of unit of the headline in our reelection, add a Server Behaviors to it----Go To Detail Page, if pursue:



Our purpose is to want to Detail.asp this page delivers an ID to be worth, make its can the record that correct extraction gives us to want. Finished the join that a More adds again after these, point to More.asp, in order to show more news records.

Page effe ct shows like plan institute:



In More.asp in this page, we need to revise a moment ago home page aspect simply only can use. Open the dialog box that founds record volume, the Top 5 that we add take out (all records that will take out side of database the outside and the inside so) , a number that revises Repeat Region every page to show next it is 10, expunge the join of More again, insert Insert - next>Live Objects ->Recordset Nagavition Bar, such we can turn over a page to show news. If the page pursues:



Next we have news detailed page (namely Detail.asp) make. Resemble above what we tell is same, we obtain a page to pass the cost that come over namely in the most important thing in Detail.asp page, here is ID=x. If pursue:



Come down, make a few form, the project that establishs good record part each procrastinates go in to go, if pursue:



Arrived the page of our downstage part was finished, be abo ut to undertake tiring-room runs a page next made.

Original, right order should be to make good tiring-room run a page first, accomplish can correct accretion, delete, downstage page just has when compiling data make. Do because of downstage after all page it is data shows only just, if connect data to cannot be added, then you are done again beautifully downstage trashy also, and if the page manages to need not be used in the tiring-room that make too pursuit page is beautiful, when once make mistake,wanting to be revised afresh fast also, unlike is downstage, once the page has been designed, and when wanting to alter, be very painstaking (although Ultradev has made,this job becomes relatively simple, but give an issue easily still) . Because of us nevertheless these pages are compared simple, data structure also is simple, won't make mistake, do not emphasize this so. But when be being done after friends, still had better be according to tiring-room - > downstage i t is better that such order will do.
The 5th chapter: Become a relatively simple website backstage supporter (2)

Tiring-room management page can divide for 3 parts:


Data is added

Data editor, delete

Land test and verify

We are added from data first make. Through the study in front we know, the page that makes a data add in Ultradev is to be in what do not pass simply, need Insert - only>Live Objects ->Recordset Insertion Form went. If pursue, it is the page that adds news, add administrator user similar also, did not tell more:



Found after finishing, if pursue:



This is the page that adds new user:


Open a browser to see the effect:



But our issue came. Add evening when you after data, open corresponding detailed information page from home page, at that time you will see the data with trenchant paragraph is returned to be squ eezed into posse now when a moment ago was being added. Former section was not dropped!



After the netizen of software of all use UltraDev has encountered the character on Asp page to derive from the database certainly, squeeze into the phenomenon of posse, the blank space that inputs at first and line feed were done not have. Because be in Asp statement,did not handle the blank space in the database and line feed at all. Of course, the blank space in learning the netizen of Asp process designing to be able to join code to change a database by oneself and line feed become Html code, still perhaps can refer in the character Html code changes blank space and line feed to be outputted next first when entering a database. But the netizen that no matter be which kind of means,crosses Asp to learning is undoubtedly as nightmare general. Although learn to change that to also must need to be in every Asp page,revise a source by hand, already take time arduous, do not have very convenient means of settlement for a long time all the time.

How to do? Ah, not urgent, be about to use the plug-in unit function that has told before us here.

Here we will use a plug-in unit---Spdesign Format will help us realize a function (click here to download plug-in unit) .
Next I recommend to be able to solve the UltraDev plug-in unit of this difficult problem to everybody: Use method is very simple, the order that this plug-in unit uses after needing to choosing dynamic data only can finish the format of blank space and line feed to change.

The graph is like after plug-in unit is installed



How to use this plug-in unit? Very simple, see figure below, be be clear at a glance? *_ "



After using plug-in unit, look carefully at our page again, ah, where is the result that you want?



The page that adds a record is photograph contrast is simpler, if you read the content that interprets before us to had made a few exercises seriously, believe those who come to you can be made very quickly. Good, next, the editor that what we should tell is a record and deleted. We had been analysed in front, the edition that should have a record and delete, deliver to be worth another page from a page namely actually, the cost that takes another page to deliver the past according to this next takes out that corresponding exclusive record to bring to bear on the editor, behavior that delete. So, we should make a page above all, as deliver a value to use. This page is very simple, it is indication page of a data actually, added two join nevertheless: Revise delete pitch on these two join, bring to bear on the behavior of Go To Detail Page in Server Bahaviors: It is Change_article.asp and Del_article.asp respectively two pages (here we in order to edit, delete news to serve as example, the management of the user also is same)





Last page shows like plan i nstitute:



The result shows in the browser:

No comments:

Post a Comment