title: Search the data by keypress event on the textbox
body: <p>i have code behind from my asp .net page, to add listener atribute on all my text boxes like this :</p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          If Session("UserID") Is Nothing Then
              Session("UserID") = Request.ServerVariables("LOGON_USER").Replace("ActiveDir\", "")
          End If
          Label7.Text = Session("UserID").ToString
          If Not IsPostBack Then
              If CAuth.AuthUser(Session("UserID"), "20") Then
                  FillData()
                  'txtInquiryDate.Text = DateTime.Now.ToString(txtInquiryDate_CalendarExtender.Format)
                  txtAccount.Attributes.Add("onKeyPress", "doClick('" + btnSearch.ClientID &amp; "',event)")
                  txtAmount.Attributes.Add("onKeyPress", "doClick('" + btnSearch.ClientID &amp; "',event)")
                  txtCustName.Attributes.Add("onKeyPress", "doClick('" + btnSearch.ClientID &amp; "',event)")
                  txtInquiryDate.Attributes.Add("onKeyPress", "doClick('" + btnSearch.ClientID &amp; "',event)")
  
              Else
                  Response.Redirect("NoAccess.aspx")
              End If
          End If
  
      End Sub
  </code></pre>
  
  <p>and there's javascript function on my ASPX page. :</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      function doClick(buttonName, e) {
          //the purpose of this function is to allow the enter key to 
          //point to the correct button to click.
          var key;
  
          if (window.event)
              key = window.event.keyCode;     //IE
          else
              key = e.which;     //firefox
  
          if (key == 13) {
              //Get the button the user wants to have clicked
              var btn = document.getElementById(buttonName);
              if (btn != null) { //If we find the button click it
                  btn.click();
                  event.keyCode = 0
              }
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>if i keypress the text boxes, it should automaticly like press the search button, and rebind the datagrid, but it didn't do that, is there any solutions?</p>