HtmlFileInput control PostBack

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFydHkgVS4=?=, Sep 20, 2004.

  1. Within a form in an application I have section where the user selects the
    number of files they need to upload. Using Javascript I right the
    HtmlFileInput boxes within span element on the page. I have an object that I
    wrote that will accept the HttpPostedFile and do some processing. However, I
    get an "Object reference not set to an instance of an object" on the postback
    when I try to reference one of the input fields.

    I realized this is because the controls were not part of the controls
    collection when the page loaded. If I do a Request.Files I get 0.

    Does anyone have any idea how I can use a Javascript function to write
    htmlfileinput controls to a page and then get the request.files collection on
    postback when the user clicks a submit button? Note: This file upload section
    is contained within a form with several other fields (webform controls) that
    must be processed also.

    I really want to avoid a postback on selectedindexchanged on the
    dropdownlist that the user selects the number of files.

    Thanks a bunch.
     
    =?Utf-8?B?TWFydHkgVS4=?=, Sep 20, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shimon Sim

    HtmlFileInput control

    Shimon Sim, Aug 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,367
  2. Psych971
    Replies:
    5
    Views:
    4,655
    bruce barker
    Dec 17, 2004
  3. =?Utf-8?B?Q2hhZA==?=

    Postback not being set to True on first postback

    =?Utf-8?B?Q2hhZA==?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    517
    =?Utf-8?B?Q2hhZA==?=
    Apr 4, 2005
  4. Alan Silver
    Replies:
    2
    Views:
    360
    Alan Silver
    Jun 16, 2005
  5. gnewsgroup
    Replies:
    1
    Views:
    393
    gnewsgroup
    Feb 13, 2008
Loading...

Share This Page