function callAjax() {
var messageContent = "Text9";
var params = "MessageContent=" + messageContent;
alert(params);
//ajax to check length
var xmlHTTPObject = new ActiveXObject("Microsoft.XMLHTTP");
if (xmlHTTPObject == null) return null;
xmlHTTPObject.Open("POST", "http://localhost:51240/WebSite1/Ajax.aspx", true);
//alert('/sites/MB/_layouts/MB2010/MBCheckMessageSize.aspx');
xmlHTTPObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
// xmlHTTPObject.setRequestHeader('Content-Type', 'application/text; charset=utf-8');
xmlHTTPObject.setRequestHeader('Content-length', params.length);
///xmlHTTPObject.setRequestHeader('Connection', "close");
//alert("/_layouts/AMAT.MOLDS/GetMoldPartNo.aspx?MatNo="+partNumberVal);
xmlHTTPObject.onreadystatechange = function () {
if (xmlHTTPObject.readyState == 4 && xmlHTTPObject.status == 200) {
// alert(a.responseText);
if (xmlHTTPObject.responseText.length > 0) {
alert(xmlHTTPObject.responseText);
}
else {
//alert("Else Block");
}
}
}
//alert(d);
xmlHTTPObject.Send(params);
}
CS Page Code
Request.Form["MessageContent"];