title: How to return value from asp.net page called by jQuery Get() Method
body: <p>How to return some value from asp.net page that is called using jQuery Get() method ? The get method is given below and i want the alert() should display the returned value. </p>
  
  <p>The get() calls "result.aspx" page that return a string and that string i want to show in alert(). </p>
  
  <pre><code>$.get("result.aspx",
      {
          name: "Donald Duck",
          city: "India"
      },
      function (result, status, xhr) {
          alert(result);
      }
  );
  </code></pre>
  
  <p>The result.aspx code is:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          LoadReturn();
      }
  }
  void LoadReturn()
  {
      string name = Request.QueryString["name"];
      string city = Request.QueryString["city"];
      string returnValue="Hello Mr."+ name + " who lives in " + city;
  
      //How to return value of returnValue to the jquery get() function. 
  
  }
  </code></pre>
  
  <p>How to return value of returnValue to the jquery get() function ??</p>
  
  <p><strong>Update</strong>
  I tried the response.write(). It is able to return the data to jquery get() method. </p>
  
  <pre><code>Response.Write(returnValue);
  </code></pre>
  
  <p>Only problem is that it is also sending me the full HTML of the result.aspx page. Which i don't want. 
  <a href="https://i.stack.imgur.com/gGbGu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gGbGu.png" alt="enter image description here"></a>
  How can i prevent the unnecessary HTML from reaching the jquery get() method?</p>