title: C# / jQuery using ajax, not using the encosia example
body: <p>I am playing with C# and jQuery (Ajax). In a effort to keep the C# code as short and clean as possible when creating a Ajax request, without using the Encosia example (in short without ASP.NET for the Ajax calls). The response can be XML, JSON or plain (parts) HTML.</p>
  
  <p>I got a working version, but is this preferable to do? Or should I consider a other method?</p>
  
  <p>I do get 1 warning (for the ajax.aspx page) in VS2010 express (a search of this error doens't gives me a <a href="http://connect.microsoft.com/VisualStudio/feedback/details/264711/validation-the-element-html-occurs-too-few-times" rel="nofollow">satisfied answer</a>)</p>
  
  <p><strong>Warning</strong><br>
      Validation (): Element 'html' occurs too few times. </p>
  
  <p><strong>default.aspx</strong></p>
  
  <pre><code>&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
  
     &lt;div id="Result"&gt;&lt;/div&gt;
  
     &lt;script type="text/javascript" language="javascript"&gt;
        $(function () {
           $.ajax({
              url: "AJAX.aspx",
              success: function (data) { $("#Result").html(data); }
           });
        });
     &lt;/script&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p><strong>ajax.aspx (there is only this line on this page)</strong></p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" 
                         CodeFile="AJAX.aspx.cs" Inherits="AJAX" %&gt;
  </code></pre>
  
  <p><strong>ajax.aspx.cs</strong></p>
  
  <pre><code>using System;
  using System.Text;
  using System.Data;
  
  public partial class AJAX : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          Response.Clear();
          Response.Write("Hello world");
          Response.End();
      }
  }
  </code></pre>