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

  • Building JavaScript tools in a single HTML file

    #​765 — December 12, 2025 Read on the Web JavaScript Weekly Useful Patterns for Building HTML Tools — In many situations, you don’t need a full-on framework to build useful tools; just HTML, JavaScript and CSS in a single file will do the job fine. Simon’s become a bit of an expert by rolling out

    Posted by Posted on December 12, 2025
    0
  • How the Seattle Times is using pnpm

    #​604 — December 9, 2025 Read on the Web 🗓️ A quick notice that Node Weekly will be moving to Thursdays in January 2026, as part of a schedule reshuffle for most of our newsletters. We still have one more week before the Christmas break, though, so we’ll be back next Tuesday with our 2025 roundup!__Your editor,

    Posted by Posted on December 10, 2025
    0
  • What’s the story? JavaScript’s 30!

    #​764 — December 5, 2025 Read on the Web JavaScript Weekly 🎉  JavaScript Turns 30 Years Old  🎉 Back in May 1995, a 33 year old Brendan Eich built the first prototype of JavaScript in just ten days, originally codenamed Mocha (and then LiveScript). On December 4, 1995, Netscape and Sun Microsystems officially announced ‘JavaScript’ in a

    Posted by Posted on December 5, 2025
    0
  • Comparing performance across Node versions and ARM vs x86

    #​603 — December 2, 2025 Read on the Web Tinybench 6.0: A Tiny, Simple Benchmarking Library — Uses whatever precise timing capabilities are available (e.g. process.hrtime or performance.now). You can then benchmark whatever functions you want, specify how long or how many times to benchmark for, and get a variety of stats in return –

    Posted by Posted on December 2, 2025
    0
  • Algorithms visualized and demonstrated in JavaScript

    #​763 — November 28, 2025 Read on the Web JavaScript Weekly Over 150 Algorithms and Data Structures Demonstrated in JS — Examples of many common algorithms (e.g. bit manipulation, Pascal’s triangle, Hamming distance) and data structures (e.g. linked lists, tries, graphs) with explanations. Available in eighteen other written languages too. Oleksii Trekhleb et al. TypeScript: From

    Posted by Posted on November 28, 2025
    0
  • Guess who’s back, back again? Shai-Hulud.

    #​602 — November 25, 2025 Read on the Web How a Summer in Abruzzo Helped Bring Type Stripping to Node.js — Node.js TSC member and committer Marco tells the personal tale of what it took to bring type stripping (now considered stable) to Node. It’s neat to get the back story. He’s now working on

    Posted by Posted on November 25, 2025
    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
  • Building JavaScript tools in a single HTML file
  • How the Seattle Times is using pnpm
  • What’s the story? JavaScript’s 30!
  • Comparing performance across Node versions and ARM vs x86
  • Algorithms visualized and demonstrated in JavaScript
https://flatlogic.com/generator
COPYRIGHT © 2025 - Codepolice