|
Enable the ‘required’ field validation for the search control to make sure no records
are displayed until the user enters text into the search field and clicks ‘Go’.
Step 1: In the Design tab in Iron Speed Designer, locate the 'Go' button for the search
control. Double-click the ‘Go’ button to display the Properties dialog. In the Attributes tab,
set the button's ‘CausesValidation’ attribute to ‘True’.
| Pass-Through Attribute |
Value |
Type |
| Button- CausesValidation |
True |
HTML Encoded |
Step 2: In the HTML layout page, add a RequiredFieldValidator control for the search area text box.
|
<asp:RequiredFieldValidator runat="server" id="OrdersSearchRequiredFieldValidator" ControlToValidate="OrdersSearchAreaTextBox" ErrorMessage="A search value is required." Enabled="True"/> |
The RequiredFieldValidator is a .NET control that ensures a value is entered for the field. Be sure to specify values for the ‘ControlToValidate’ and ‘Enabled’ attributes.
Step 3: Build and run your application.
|