title: How to make a AJAX GET call in ASP.NET MVC application
body: <p>I am learning web development. And I just want to make a simple AJAX GET call in ASP.Net MVC Application and I want visualize how it works. But I am not able to do so. I am a beginner and I could have done any silly mistakes. But as of now there are no errors in my code.</p>
  
  <p>Below is what I have:</p>
  
  <p>So, I have a <code>Index.cshtml</code> file which is already loaded. Now in that page I want to make an <code>Ajax GET call</code> to one of the <code>function</code> that I have written in the <code>HomeController</code> and action name is <code>Test</code>. I just want to hit the breakpoint in that <code>Test Action</code> of Homecontroller and return something back to the <code>Success</code> of AJAX Call.
  In HomeController I have below Action</p>
  
  <pre><code>[HttpGet]
  public ActionResult Test()
  {
      return View("hello");
  }
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code>    $.ajax({
          url: '/Home/Test',
          type: 'GET',
          success: function (html) {
              alert(html);
          },
          error: function (error) {
              $(that).remove();
              DisplayError(error.statusText);
          }
      });
  }
  </code></pre>
  
  <p>Confusion: Do I need to create a <code>cshtml</code> for <code>Test</code>. But I actually do not want that. I just want the <code>Test</code> Action to return me one data. And I will display that data in my Already opened <code>Index.csthml</code> file. </p>
  
  <p>Error: No error but I am not able to hit the breakpoint in <code>Test Action</code> of controller. Kindly note that <code>Success</code> of AJAX is hitting but I do not see any data. But I am sure it did not hit the test Action breakpoint.</p>