把这段改成
改成
<%
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的值)