Adding the search controls (ASP.NET)

Adding the search controls (ASP.NET)

A search page on the web typically contains form fields in which the user enters search parameters. When the user clicks a button, the search results are displayed.

To add the search form to the page:

  1. Open the search page and select Insert > Form > Form.

    An empty form is created on the page. You may have to enable Invisible Elements (View > Visual Aids > Invisible Elements) to see the form’s boundaries, which are represented by thin red lines.

    In the form’s Property inspector, you should select POST as the form’s Method attribute. You don’t need to specify an Action attribute for the form. The ASP.NET page will post back to itself and the search results will be displayed on the same page.

  2. Add form controls for users to enter their search parameters (Insert > ASP.NET Objects).

    You can insert any ASP.NET form control, including a TextBox, CheckBox, RadioButton, ListBox, or DropDownList control. You can add as many controls as you want to help users refine their searches. However, keep in mind that the greater the number of search parameters on the search page, the more complex your SQL statement will be.

    For each control, make sure you specify an ID attribute such as txtCity for a TextBox control or lbxCountry for a ListBox control.

    For more information, see Adding ASP.NET form controls to a page.

  3. Add an ASP.NET Button to the form (Insert > ASP.NET Objects > asp:Button).

    Make sure you specify an ID attribute for the button, such as btnSearch, and text for the button label, such as Search.

The search form is done. The next step in creating the search page is to define a DataSet to find and store the search results. See Searching with only one search parameter (ASP.NET).

Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly
Building ColdFusion Applications Rapidly
Building ASP.NET Applications Rapidly
Building ASP and JSP Applications Rapidly