62,244
社区成员




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script language="javascript" type="text/javascript">
function doit() {
document.getElementById("form").submit();
}
</script>
</head>
<body>
<form action="Handler1.ashx" id="form" method="post" enctype="application/x-www-form-urlencoded">
<input id="name" />
</form>
<input onclick="doit()" type="button" />
</body>
</html>
普通html向ashx提交数据没有任何问题.但控件必须给一个name属性
如<input name="test" id="test" type="text">
在ashx中取值
String test=Context.Request.Form["test"];
string s = HttpContext.Current.Request.Form["name"];