Results 1 to 3 of 3

Thread: [02/03] File Upload contol loses value

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Location
    Wonder Lake, IL
    Posts
    38

    [02/03] File Upload contol loses value

    I have a file upload control on my aspx page and everything works fine if the user enters all the required information. The problem is when a a required field is not assigned a value the File upload control loses its value.

    Is there a way to retain the value in the file upload control when there is a page postback?

  2. #2
    Addicted Member rabid lemming's Avatar
    Join Date
    Feb 2005
    Posts
    210

    Re: [02/03] File Upload contol loses value

    You could use Cache code to hold the information and pass it back to the page on post back...that should do the trick for you

    I will wait for death with a smile and a big stick

  3. #3
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    Re: [02/03] File Upload contol loses value

    If a postback occurs, the file upload field will blank out. This is a standard on the Web regarding upload input boxes and it cannot be overridden. You can't even set a default value for it, for the same reason.

    My suggestion is to usually use a pop up window to attach files so that the functionality of uploading is separated from the form itself, but of course doing so will require additional coding.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width