UltraDev 101

Formatting and Repeating Records
  


  


Records are easy to insert and format on the page once you've completed page 5. So let's take a look at how to do this. I envision in my mind that I want my final outcome to display peoples names like this on a page:



First NameLast Name
  
  

So basically, on your "displayrecords.asp" page, just build a simple HTML table and format it the way you want it to look. Here's mine below:


Now we just need to insert the information that will display records for us. Go back to your Window > Data Bindings and in the list you’ll see the recordset you created that says Recordset (rsGetRecords). Click the plus sign by the recordset name and it will drop down all the fields that you have in your database. Select the cell in the table where you want the first name. Then select first from the menu and press Insert. You’ll now see {rsGetRecords.first} appear in the table.



Now do the same thing for the last name and insert it into the left hand side of the table. If you want to change the font, size, color or anything like that just select the text in the table like you normally would and change it there. You have total control over this type of display stuff.

Ok, now we are on a roll. But if were to look at the file now on the web, it would only pull up the first record in the database. We don’t want this. We want it to pull up all the records in the database and sort them from A to Z for us. So let’s make the database *repeat* the region of the first and last name. Under Window > Data Bindings, select the Server Behaviors tab and then press the +(plus) sign and select Repeat Region from the drop down menu. It will then pull up a new Repeat Region window where you can specify how many records you want it to display. For this exercise let’s do 5 records.


Now you your .asp file should have a repeat region selected area like this:


If you go to the browser now and type in (for our example):
http://mediaprod-nt/workshop/displayrecords.asp

I’ll get an .asp page that is processed by Personal Web Server that looks like this:



So, it’s all working great! It looks nice, it displayed 5 records out of our 14 total in sorting order from A to Z.

We now know how to get records onto the page to be displayed. So let’s get into some counting features and allowing people to use Previous and Next buttons to go through 5 records at a time.
  


  




© Copyright 1999-2001/ USA America Inc.All rights reserved. Last updated --  Read our Privacy Policy

  
Webmaster & Submissions:
Contact Administration

Site Advertising:
Rates and Information


» Get tutorial template
» Virtual-FX Team




 

Download the buttons
Join our mailing list!
Enter your Email address below, then click the 'Join List' button: 

Subscribe Unsubscribe
Powered by ListBot