title: How do I get the User Entered Value in AjaxControlToolkit ComboBox when the enter key is pressed?
body: <p><strong>The Problem:</strong></p>
  
  <p>The user entered value is missing in the .Text attribute of the AjaxControlToolkit ComboBox when the enter key pressed.  Also the “on change” events events are not called but I am not using postbacks anyway so I do not care.</p>
  
  <p>Example:  </p>
  
  <pre><code>private void BuildFileListDetails(NHibernateDataProvider _providerM)  
  {  
      int resultsPage = Convert.ToInt32(ddlNavPageNumber.Text);  
      const int RESULTS_PAGE_SIZE = 100;  
  
      // The cbFileName.Text equals "" Not what user entered  
      string searchFileName= cbFileName.Text;  
  
      var xrfFiles = _providerM.GetXrfFiles(searchFileName, resultsPage, RESULTS_PAGE_SIZE);
  
      gvXrfFileList.DataSource = xrfFiles;
  
      gvXrfFileList.DataBind();
  
  }
  </code></pre>
  
  <p><strong>My Solution:</strong></p>
  
  <p>I needed to access the AjaxToolkit "ComboBox" imbedded TextBox control's .Text to access the value entered by user.</p>
  
  <pre><code>private void BuildFileListDetails(NHibernateDataProvider _providerM)
  {
  
      int resultsPage = Convert.ToInt32(ddlNavPageNumber.Text); 
      const int RESULTS_PAGE_SIZE = 100;
      string searchFileName;
  
      //The Solution: Access the AjaxToolkit "ComboBox" imbedded TextBox control's .Text to access the value entered by user.
      TextBox textBox = cbFileName.FindControl("TextBox") as TextBox;
      if (textBox != null)
      {
         searchFileName = textBox.Text; //textBox.Text = "User Entered Value"
      }
  
      var xrfFiles = _providerM.GetXrfFiles(searchFileName, resultsPage, RESULTS_PAGE_SIZE);
      gvXrfFileList.DataSource = xrfFiles;
      gvXrfFileList.DataBind();
  }
  </code></pre>