Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6918065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:48:41+00:00 2026-05-27T09:48:41+00:00

I made a dynamically multi upload form with file type inputs. When you select

  • 0

I made a dynamically multi upload form with file type inputs. When you select a file new file input will appear. When submit the form all inputs captured by “Request.Files” at code behind.

There is no problem when i generate those file in a .aspx file but when i use Web User Control (.ascx) page “Request.Files” add 1 more request (for the blank file input).

Why ascx count the balnk input?

I share the codes below:

MultiImage.ascx

<ul id="imagesToUpload">
    <li><input type="file" class="imageToUpload" runat="server" /></li>
</ul>


<script type="text/javascript">
    $('.imageToUpload').live('change', function () {
        $(this).parent().append('<div class="imageInfoContainer"><span>Yüklenen görsel: ' + $(this).val() + ' </span><div class="deleteImage">Sil<div><div>');
    if ($('input:file').length < <%= MaxImageNumber %>) {
        $(this).parent().parent().append('<li><input type="file" class="imageToUpload" runat="server" /></li>');
        }
    });

    $('.deleteImage').live('click', function () {
        $(this).parent().parent().remove();
        if ($('input:file').length < 1) {
            $('#imagesToUpload').html('<li><input type="file" class="imageToUpload" runat="server" /></li>');
        }
    });
</script>

MultiImage.ascx.cs

var imageCollection = Request.Files; //Counts all file inputs included the blank one
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:48:41+00:00Added an answer on May 27, 2026 at 9:48 am

    Why ascx count the balnk input?

    You mean why does HttpRequest object count that input? Because it is present in the request. You can however easily check if it is empty or not by looking at the HttpPostedFile.ContentLength property of each element inside Files collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a form which adds controls dynamically with user selecting the type
i have a dynamically made prototype: typedef double ICEDouble; -(BOOL) getPosition:(SyDRpcInterfacePositionType)type longitude:(ICEDouble *)longitude latitude:(ICEDouble
I'm trying to add a new FilteringSelect widget dynamically to a preexisting form I
I have many dynamically generated pages, made by the same PHP file, and I'd
I have a huge query that is being made dynamically, but I want the
I made an html file called test.html then I navigated to it as http://site.com/test.html?test1=a
I made a small script which basically uses jQuery uplodify to upload files to
I generate dynamically graphic in my controller: if not file exists (unique filename) then
I am attempting to capture a very large image that was made dynamically within
well, i'm almost new to c# and i couldn't figure out how multi-leveled-arrays work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.