title: Allow button click function on the Enter Key in Textbox
body: <p>In MVC .NET,
  I have one textbox to allow search associated with one button of type "button" (I can not make it submit due to functionality) which when clicked calls one method that allows to search.</p>
  
  <p>When the user enters search number in textbox and hits 'Enter' key on keyboard I want search to be called.</p>
  
  <p>I do not have any submit button in my <code>@Html.BeginForm()</code></p>
  
  <p>Following is the code</p>
  
  <pre><code>@Html.TextBoxFor(m=&gt;m.SearchNo,new {@class="form-control",@maxlength="12" });
  
  &lt;input type="button" id="btnSearch" value="Search" onclick="search();"/&gt;
  </code></pre>
  
  <p>I have tried using following but it does not work:</p>
  
  <pre><code>$("#SearchNo").keyup(function(event){
      if(event.keyCode == 13){
          $("#btnSearch").click();
      }
  });
  </code></pre>
  
  <p>Please help me with this</p>