Here is my current code:
Here is for default.aspx
<body>
<form id="form1" runat="server">
<div id="mydiv">
</div>
</form>
<script>
$(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); }
});
})
</script>
</body>
Then for Default2.aspx, I want to access the data like this:
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Request.Form["name"].ToString();
}