title: How can I use c# asp.net to get data from url?
body: <p>I'm trying to get some info I sent by form to angularJS in my c# asp.net backend, and I'm having trouble doing it.</p>
  
  <p>Visual Studio won't let me compile because it says:</p>
  
  <blockquote>
    <p>Error CS0120: an object reference is required for the nonstatic field, method, or property 'member'</p>
  </blockquote>
  
  <p>That's is my controller</p>
  
  <pre><code>public class SearchController : ApiController
  {
      public string Get()
      {
          string test = HttpContext.Request.QueryString["txt_search"];
          return test;
      }
  
  }
  </code></pre>
  
  <p>Here's what I got in my angularjs:</p>
  
  <pre><code>$scope.sendForm = function () {
      console.log($scope.model.search);
      $http({
          method: 'GET',
          url: '/api/search?txt_search=' + $scope.model.search
      })
      .then(function () {
          console.log('sucesso a executar o post');
      }, function () {
             console.log('Erro ao executar o post');
         });
  };
  </code></pre>