ajax中responseText返回整个asp~~急待解决~~

2024-11-16 13:31:51
推荐回答(1个)
回答(1):

把这段改成

改成
<%
void Page_Load()
{
switch (Request.Params["value"])//获取url中value的值,并判断
{
case "Contacts":
Response.Write("box1|
Contacts
William Moe 1, Acacia Avenue
Jane Doe, 2 Willow Tree Lane");
Response.Close();
break;
case "Calendar":
string dt = DateTime.Now.ToString();
Response.Write("box2|
Calendar:
" + dt);
Response.Close();
break;
case "Adverts":
string source = "wrox_logo.gif";
Response.Write("box3|
Advert:
");
Response.Close();
break;
}
}
%>
这样再试试看 如果没有对的话 你可以直接访问display.aspx输入参数看看页面输出的源代码 (源代码就是xhr.responseText的值)