в моем коде responseText не работает.Предполагается, что текст, введенный в текстовое поле + ": ваш запрос был просмотрен syam"
<html>
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript">
var xmlHttpRequest;
function sSignature(str) {
xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.onreadystatechange = function() {
if (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200) {
document.getElementById("target").innerHTML = xmlHttpRequest.responseText;
}
}
xmlHttpRequest.open("GET", "AjaxResponse.aspx?q=" + str, true);
xmlHttpRequest.send();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
enter a string :<input type="text" id="textbox" onkeyup="sSignature(this.value)"/>
<span id="target">text should change here</span>
</div>
</form>
</body>
</html>
На странице с выделенным кодом в page_load ()
string sRequest = Request.QueryString["q"];
var sResponse = sRequest+ " :Your request has been seen by syam";
Response.Write(sResponse);