Dynamic Web Tutorials and Notes

Search pages

We will make a page that searches the database by the EmployeeID

  1. File>New
  2. Select Dynamic Page
  3. Click ASP VB Script
  4. Click ‘Create’
  5. Save the page as search.asp
  6. You also need to make a search results page called search_results.asp
  7. Open search.asp and insert a form – Insert > form
  8. In the form properties window click on the Action box folder and browse to the search_results.asp page
  9. Name the form ‘search_form’
  10. Make sure method is set to POST
  11. Inside the form insert a 2*2 table – Insert > table
  12. Inside the top left cell type ‘Please enter Employee ID’
  13. Insert a text box into the top right cell and call it ‘search’ – Insert > Form Objects > Text Field

  14. In the bottom right cell insert a submit button -Insert > Form Objects > Button
  15. Save the page
  16. Open search_results.asp
  17. Create a DSN to your database if necessary (see IV)
  18. Create a Recordset (see V) – rsSearch
  19. When creating the recordset set the filter to EmployeeID (what we will search by)
  20. The next box to the right is set to =
  21. The next box underneath is set to Form Variable
  22. Type ‘search’ into the last box (this is the name of your text box in the search page)
  23. Still in the search_results.asp page build a 2*11 table to contain the results of your search.
  24. As in VI drag the bindings into the right hand table column
  25. Type the titles in the left column
  26. Save the pages
  27. Restart the machine and enter a search query to test
Valid CSS! . Valid XHTML 1.0 Strict . Level Triple-A conformance icon, 
          W3C-WAI Web Content Accessibility Guidelines 1.0 .