- 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
posts back to itself and the search results are displayed on the
same page.
- 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 Add ASP.NET form controls to a page.
- 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.