4

I know with FileUploader you need to do a full post back. But I thought with AsyncFileUpload didn't work this way. My hasFile is always returning false. (I upload an image, and then I hit the form submit button, to find out my asyncFileUpload returns false)

<asp:AsyncFileUpload ID="AsyncFileUpload1" Width="200px" ToolTip="Upload Image" 
                OnClientUploadComplete="showUploadConfirmation"
                ThrobberID="Throbber" UploaderStyle="Traditional" runat="server" 
                OnClientUploadError="showUploadError"
                OnClientUploadStarted="checkExtension" 
                onuploadedcomplete="AsyncFileUpload1_UploadedComplete"  />
Spooks
  • 6,937
  • 11
  • 49
  • 66
  • 1
    hmm, I think maybe I should be checking the hasFIle on the OnUploadedComplete... which means I wouldn't even need the check... which makes this a lot easier... right? – Spooks Nov 17 '10 at 20:08

2 Answers2

3

Ah! Basically the file already is uploaded(right after I click a file), so when I try a submit on the form there is nothing there anymore. Ajax is too sneaky for me.

Spooks
  • 6,937
  • 11
  • 49
  • 66
0

Are you doing anything in your PageLoad if yes you should wrap the code in

 if(!this.IsPostBack) 
 {
    do something whatever that is you do with AsyncUploader
 }
dexter
  • 7,063
  • 9
  • 54
  • 71