Skip to content

Codepolice

  • ⤫

Request.Files is Empty in a Web Forms Application

Posted by Judy Alvarez Posted on February 28, 2022March 1, 2022
0

I was fixing some bugs in my application today and ran into a tricky bug. My application is based on Webforms but I use a lot of jQuery and other more modern technologies. In one place I have an upload form that is dynamically populated with jQuery templates. Since i create all my <input type”file”> with jQuery i can’t use ASP.NET’s built-in <asp:FileUpload>, i can’t even have then as “runat=server”.

Today when I made some changes I removed the last file upload that had runat=” server” on it and a couple of hours later I noticed that all uploads had stopped working. After some debugging it hit me that I should check if the “auto-generated” form that asp.net ads to each page had the enctype=” multipart/form-data” attribute still. And of course, that was gone.

Naturally, ASP.NET removed that attribute when I removed the last file upload that had “runat=server”. So if you do not want any file upload that has runat=server or <asp:fileupload> you have to add type manually to your form.

Page.Form.Enctype = "multipart/form-data";
Categories: JavascriptTagged: asp dot net developers, asp net bootstrap, asp net core web app, asp net developers india, asp net development company usa, asp net development outsourcing, asp net for web development, asp net html to pdf, asp net mvc 3, asp net mvc grid, asp net mvc page life cycle, asp net mvc pdf, asp net mvc session management, asp net mvc shopping cart, asp net mvc with angularjs, asp net technology, asp net themes, asp net vs, asp net vs django, asp net web api 2, asp net web form, asp net webapp, asp net websites, asp. net mvc interview questions, docker asp net, mvc example in asp net, shopping cart asp net c# step by step, web development asp net, web development with asp net, www dadeschools net students asp

Post navigation

Previous Previous post: Using log4net to Send Mail With SmtpAppender In a Console Application
Next Next post: Build, Git Commit, FTP When You Publish In Visual Studio

Related Posts

  • Babel 8 RC Arrives, Gatsby Lives, Lodash Resets

    #​771 — February 3, 2026 Read on the Web JavaScript Weekly Four Heavyweights Drop Updates Four stalwarts of the JavaScript ecosystem all shipped notable releases this week, and odds are you’re using at least one of them: Gatsby v5.16 proves Gatsby, once considered neck-and-neck with Next.js in the React world, is not ‘dead’. The headline

    Posted by Posted on February 3, 2026
    0
  • A smoother way to ship Node apps

    #​609 — January 29, 2026 Read on the Web 🌊 Improving Single Executable Application Building in Node — First introduced two years ago, Node has a (still experimental) feature to build single executable applications that can be deployed to machines that don’t have Node installed. This week’s Node.js 25.5 release, with its –build-sea flag, moves the

    Posted by Posted on January 29, 2026
    0
  • What’s next for JavaScript frameworks in 2026

    #​770 — January 27, 2026 Read on the Web JavaScript Weekly Introducing LibPDF: PDF Parsing and Generation from TypeScript — LibPDF bills itself as ‘the PDF library TypeScript deserves’ and supports parsing, modifying, signing and generating PDFs with a modern API in Node, Bun, and the browser. GitHub repo. Documenso JavaScript Frameworks – Heading into 2026

    Posted by Posted on January 27, 2026
    0
  • require(esm) now stable in Node 25

    #​608 — January 22, 2026 Read on the Web Node.js 25.4.0 (Current) Released — Another gradual step forward for Node with require(esm) now marked as stable, as well as the module compile cache, along with a variety of other minor tweaks. Joyee Cheung of the Node team has written a thread on Bluesky going deeper

    Posted by Posted on January 22, 2026
    0
  • A big week for jQuery

    #​769 — January 20, 2026 Read on the Web JavaScript Weekly jQuery 4.0 Released — 20 years on from its original release, the ever-popular (in terms of actual usage) library reaches 4.0 with a migration to ES modules (compatible with modern build tools) along with dropping support for IE 10 and older. With jQuery being

    Posted by Posted on January 20, 2026
    0
  • A new guide to configuring Node packages

    #​607 — January 15, 2026 Read on the Web ⚠️ The Node.js January 13, 2026 Security Releases — Originally expected in December, these releases (of Node.js 25.3.0, 24.13.0, 22.22.0, and 20.20.0) finally landed this week, largely due to their complexity and the scope of the vulnerabilities they tackle. More on that in the next item! The Node.js

    Posted by Posted on January 15, 2026
    0
Judy Alvarez

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Codepolice

  • Github
  • Atlassian
  • Flatlogic
  • Xero
  • Jetbrains
  • Figma
  • Babel 8 RC Arrives, Gatsby Lives, Lodash Resets
  • A smoother way to ship Node apps
  • What’s next for JavaScript frameworks in 2026
  • require(esm) now stable in Node 25
  • A big week for jQuery
https://flatlogic.com/generator
COPYRIGHT © 2026 - Codepolice