1

I am writing an application that requires a user to upload files to the server machine. All user interaction with the user is done via JQuery UI modal popups. I created a test page to see that the AsyncFileUpload control works, and everything works fine on it. I added the AsyncFileUpload to the webform that I need it on, in a modal popup, but for some reason the server side event is never fired. The only difference on this page from the test page is that I send a variable through on the querystring which I, on initial load of the page, store in the viewstate (so it isn't required on future postbacks). Any ideas?

Thanks

tardomatic
  • 2,396
  • 3
  • 21
  • 29
  • Something I forgot to mention is that another difference is that the test form is a straight webform, while the actual page is a web content form (it has a masterpage) – tardomatic Oct 20 '09 at 06:34

2 Answers2

1

When dealing with AsyncFileUpload Control's Event, store any data in Session state instead of viewstate.

anonim
  • 2,494
  • 6
  • 30
  • 40
1

When you use AsyncFileUpload you must set the right params in the "form" tag, that is placed in your Page or MasterPage:

 <form id="form1" runat="server" enctype="multipart/form-data" method="post">

If you don't set the right enctype and method UploadedComplete will never fire, and you won't be able to get FileUpload.FileBytes since FileUpload.HasFile returns true only during UploadedComplete execution.

I suppose that you didn't set the correct enctype on your modal popup.

Besides, prevoius versions of AsyncFileUpload didn't work on Chrome. Actual version (4.1.50731.0) solved the problem.

Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70