对于这样的问题,有很多解决方法,如果你返回的内容是简单的内容,如注册用户时候的验证信息,只需返回存在与否,那么可以采用下面最最简单的代码实现: C# 代码<%@ Page Language="C#" %> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> //测试方法1<br> public String GetSimpleMethod(String inputData)<br> {<br> //业务处理。<br> return "你输入的值:" + inputData;<br> }</p> <p> protected void Page_Load(object sender, EventArgs e)<br> {<br> if (Request.QueryString["input"] != null)<br> {<br> Response.ClearContent();<br> Response.Write(GetSimpleMethod(Request.QueryString["input"]));<br> Response.End();<br> }<br> }<br> <br> var textBox1 = "<%=TextBox1.ClientID %>";<br> function GetData() {<br> var t = document.getElementById(textBox1);<br> var h = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP");<br> h.open("GET", "<%=Request.FilePath %>?input=" + encodeURIComponent(t.value) + "&" + Date.parse(new Date()), true);<br> h.setRequestHeader("Connection", "close");<br> h.onreadystatechange = function() {<br> if (h.readyState == 4) {<br> if (h.status == 200) {<br> document.getElementById("info").innerHTML = h.responseText;<br> }<br> }<br> }<br> h.send(null);<br> } <br>