页面:a.html
<!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>提交表单到 Handler1.ashx
在 Handler1.ashx 无法获得传来的值????

解决方案 »

  1.   

    你看看这个表单是否是from runt="server"表单内。。如果,是不行,要把它移出来
      

  2.   

    因为你没有为
    <input id="name" />
    添加name属性
    <input id="name" name="name"/>
      

  3.   

    楼上2位 没看懂题目。我是将一个普通的表单 提交到 Handler1.ashx。
    在一般处理文件中 怎么获得提交的值
      

  4.   


    string s = HttpContext.Current.Request.Form["name"];
      

  5.   


    普通html向ashx提交数据没有任何问题.但控件必须给一个name属性
    如<input name="test" id="test" type="text">
    在ashx中取值
    String test=Context.Request.Form["test"];
      

  6.   

    是可以取的,要用  name ,而不是id <input id="name"  name="txt_name" />
    Handler1.ashx 
    string _name = context.Request["txt_name"];  //这样就可以了string _name = context.Request["name"];  //这样取不到