1、利用method="get" 和enctype="text/plain"传值到Handler1.ashx页面:
html代码:
<form name="form1" method="get" action="Handler1.ashx" enctype="text/plain">
<input id="Submit1" type="submit" value="submit" />
<input id="Text1" name="Text1" type="text" />
</form>
Handler1.ashx代码:
string str = context.Request["Text1"];
form表单中method="post"提交:
取值:Request.Form["Text1"];
form表单中method="get"提交:
Request.QueryString["Text1"];
Request["Text1"];
AJAX中type=get传值:
取值:
context.Request.QueryString["ProjectName"];
context.Request["ProjectName"];
AJAX中type=post传值:
取值:
context.Request.Form["ProjectName"];
context.Request["ProjectName"];
if(context.Request.Files.Count)>0