title: How to post and access the data using jquery ajax in asp.net webforms?
body: <p>Here is my current code:</p>
  
  <p>Here is for default.aspx</p>
  
  <pre><code>&lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div id="mydiv"&gt;
  
      &lt;/div&gt;
      &lt;/form&gt;
      &lt;script&gt;
          $(document).ready(function () {
  
              $.ajax({
                  url: 'Default2.aspx',
                  data: "{ 'name': '" + "randel" + "' }",
  
                  type: "POST",
                  success: function () {
  
                      // alert('insert was performed.');
                      $("#mydiv").empty();
  
                      $("#mydiv").load("Default2.aspx #div");
  
                  },
                  error: function (data, status, jqXHR) { alert(jqXHR); }
              });
  
          })
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Then for Default2.aspx, I want to access the data like this:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          Label1.Text = Request.Form["name"].ToString();
  
      }
  </code></pre>