正常情况下是没有问题的.
<script >
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
xmlHttp.open("POST","test.ashx?a",false);
xmlHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
xmlHttp.send("A=1&b=2");
var str = xmlHttp.responseText
alert(xmlHttp.status)
alert(str );
</script>
看看你asxh中写了些什么?
<script >
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
xmlHttp.open("POST","test.ashx?a",false);
xmlHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
xmlHttp.send("A=1&b=2");
var str = xmlHttp.responseText
alert(xmlHttp.status)
alert(str );
</script>
看看你asxh中写了些什么?
我把xmlhttprequest总结了一下,你看看是不是基本功的问题。
其实我的ashx中什么都没有就是个空的 ,如下
<%@ WebHandler Language="C#" Class="Handler" %>using System;
using System.Web;public class Handler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable {
get {
return false;
}
}}
分没了,下不了了.
第一次出错;
msxml3.dll: 指定资源下载失败。
中断后再次运行
msxml3.dll: 未指定的错误
没有太明白你的意思?
vs 是不是自己带一发虚拟的iis服务呀?
我刚才查看过了 ashx有四种权限:GET,HEAD,POST,DEBUG