页面传来的参数传到我的handler.ashx。参数取自带有值的文本框。代码是:$(document).ready(function(){$("#").uploadify({'swf':'Scripts/uploadify.swf','uploader':'Handler.ashx','auto':true,'multi':true,'buttonText':'SelectFile(s)','removeCompleted':false,'fileTypeDesc':'PDFFiles','fileTypeExts':'*.pdf','formData':{"id":"","pwd":""}});});handler.ashx仅接收第一个值(id),但不接收pwd部分中的最新值。stringid=context.Request["id"];stringpwd=context.Request["pwd"];如何配置javascript来发送这两个参数?或者我如何配置handler.ashx来接收密码?最好的问候vardata={};数据.id=;数据.pwd=;$(document).ready(function(){$("#").uploadify({'swf':'Scripts/uploadify.swf','uploader':'Handler.ashx','auto':true,'multi':true,'buttonText':'SelectFile(s)','removeCompleted':false,'fileTypeDesc':'PDFFiles','fileTypeExts':'*.pdf','formData':obj:JSON。字符串化(数据)});});在服务器端,varjsonString=context.Request["obj"];varserializer=newJavaScriptSerializer();varjsonObjects=序列化器。反序列化>(jsonString);我唯一需要做的就是找对地方。stringid=context.Request["id"];stringpwd=context.Request["pwd"];这应该是stringid=context.Request.Form[1];stringpwd=context.Request.Form[2];小心!以上是C#学习教程:Uploadify将formdata变量传给handler.ashx共享的全部内容。如果对大家有用,需要进一步了解C#学习教程,希望大家多多关注。本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
