Monday, July 25, 2011
Sunday, July 24, 2011
Saturday, July 23, 2011
Friday, July 22, 2011
A Forgotten Story - Ajax in ASP.NET using JavaScript
http://blogs.cametoofar.com/post/raw-or-plain-ajax-in-aspnet-using-javascript.aspx
<script type="text/javascript">
function sendViaAjax() {
// Build URL to make Ajax call
var url = "Test.aspx?name=" + document.getElementById("txtName").value;
// Creates an Ajax call object
var xmlHttp; = new XMLHttpRequest();
// Specify URL to connect
xmlHttp.open("GET", url, true);
// Callback function to handle response from Server
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
alert(xmlHttp.responseText);
}
}
};
// Send Ajax request to Server
xmlHttp.send();
}
</script>
protected void Page_Load(object sender, EventArgs e){string ajxValue = "Hello " + Request.QueryString["name"] + " !";Response.Write(ajxValue); // Write the ResponseResponse.End(); // End Response}
Subscribe to:
Posts (Atom)