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
  • 13,670
  • 26
  • 78
  • 144

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
  • 66,005
  • 16
  • 114
  • 150