3

I have next form and some ashx

 <form action="FileUpload.ashx" method="POST" enctype="multipart/form-data" id="frmUpload">
        <input id="fileupload" type="file" name="files[]" />
        <input id="viewId" type="hidden" />
        <input id="moduleId" type="hidden" />
        <button id="btnUpload" type="submit">Upload</button>
    </form>

I can get file inside of ProcessRequest(HttpContext context) context.Request.Files - file containe file information, but context.Request.Form["viewId"] is empty. That should I do to get hidden fields values ?

Thanks.

Arbejdsglæde
  • 12,249
  • 20
  • 69
  • 137

1 Answers1

3

You need to add the name="viewid" also. The name attribute is used when you make post, not the id

read also: HTML input - name vs. id in the line "Used on form elements to submit information"

Community
  • 1
  • 1
Aristos
  • 63,580
  • 14
  • 112
  • 146