I have an asp.net page containing several Text Boxes and 2 buttons; Search and Reset.
When the user presses the enter
key, the search should execute without the user having to click the Search button.
I am using VS 2010 C#.
This is my code below:
<fieldset >
<legend class="ui-widget-header ui-corner-all">Case Search Criteria</legend>
<br />
<div>
<wuc:CustomLabel ID="lblCaseNumber" runat="Server" AssociatedControlID="txtSearchByCaseNumber" Text="Starting/Exact Case Number:" />
<asp:TextBox ID="txtSearchByCaseNumber" runat="server" />
<acTkt:FilteredTextBoxExtender ID="ftbCaseNumber" runat="server" FilterType="Custom" FilterMode="ValidChars" ValidChars="1234567890" TargetControlID="txtSearchByCaseNumber" />
</div>
<div>
<wuc:CustomLabel ID="lblCaseNumber2" runat="Server" AssociatedControlID="txtSearchByEndingCaseNumber" Text="Ending Case Number :" />
<asp:TextBox ID="txtSearchByEndingCaseNumber" runat="server" />
<acTkt:FilteredTextBoxExtender ID="ftbEndingCaseNumber" runat="server" FilterType="Custom" FilterMode="ValidChars" ValidChars="1234567890" TargetControlID="txtSearchByEndingCaseNumber" />
</div>
<div>
<wuc:CustomLabel ID="lblSSN" runat="Server" AssociatedControlID="txtSearchBySSN" Text="Employee SSN:" />
<asp:TextBox ID="txtSearchBySSN" runat="server" />
<wuc:DynamicValidators ID="dvalSSN" runat ="server" EntityName="SSN"
ControlAssociatedID="txtSearchBySSN"
MaskType="SSN" IsApplyMask="true" IsRequired="false" />
</div>
<div>
<wuc:CustomLabel ID="lblSearchByFirstName" runat="Server" AssociatedControlID="txtSearchByFirstName" Text="Employee First Name:" />
<asp:TextBox ID="txtSearchByFirstName" runat="server" MaxLength="100" />
</div>
<div class="hbuttons-ui">
<wuc:custombutton id="btnSearch" runat="Server" text="Search" disableonsubmit="true" data-button="true" />
<span class="navigation-overcast">
<wuc:custombutton id="btnReset" runat="Server" text="Reset" causesvalidation="false" data-button="true" />
</span>
</div>
Thanks.