Uploadify传递FORMDATA变量handler.ashx [英] Uploadify pass formdata variable to handler.ashx
问题描述
我想从我的.aspx页面中的参数发送到我的handler.ashx以FORMDATA使用.NET和C#,当我上传的文件uploadify的帮助。参数是采取从具有在值的文本框。 在code是:
I am trying to send parameters from my .aspx page into my handler.ashx with the help of "formdata" in uploadify using .net and c# when I upload a file. The parameters are take from textboxes that have values in the. The code is:
<script type = "text/javascript">
$(document).ready(function() {
$("#<%=FileUpload1.ClientID %>").uploadify({
'swf': 'Scripts/uploadify.swf',
'uploader': 'Handler.ashx',
'auto': true,
'multi': true,
'buttonText': 'Select File(s)',
'removeCompleted' : false,
'fileTypeDesc' : 'PDF Files',
'fileTypeExts' : '*.pdf',
'formData' : { "id": "<%=TBcustnom.Text %>", "pwd": "<%=Pwd.Text %>" }
});
});
handler.ashx只接收第一值(ID),但不是什么在该PWD部分
handler.ashx only receives the first value (id), but not whats in the pwd part.
string id = context.Request["id"];
string pwd = context.Request["pwd"];
如何配置发送两个参数的JavaScript?或者我怎么配置handler.ashx接收PWD呢?
How do I configure the javascript to send both parameters? or how do I configure the handler.ashx to receive the pwd as well?
最好的问候
推荐答案
我需要做的唯一的事情就是看看正确的地方。
The only thing I needed to do was to look at the right place.
string id = context.Request["id"];
string pwd = context.Request["pwd"];
这应该是
string id = context.Request.Form[1];
string pwd = context.Request.Form[2];
保重!
这篇关于Uploadify传递FORMDATA变量handler.ashx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!