I created a usercontrol with the AjaxFileUpload. I am having problems making it work efficiently.
When the UploadComplete event is triggered, multiple postbacks to server are called. After clicking the upload button, the Page_Load event from my page is called multiple times before it enters the UploadComplete block. This causes multiple binding. If I am retrieving from my database on Page_Load, this is very inefficient.
Is there anyway to prevent this server-side?
Comments: No, this behavior is by design. The first time, the client script indicates to the server the size of the next transmitted file. The second time, it indicates to the server code, that the current file upload is completed. The third time, it indicates that all files in the queue were uploaded. This server code causes one additional postback to show preview images of the uploaded files.
When the UploadComplete event is triggered, multiple postbacks to server are called. After clicking the upload button, the Page_Load event from my page is called multiple times before it enters the UploadComplete block. This causes multiple binding. If I am retrieving from my database on Page_Load, this is very inefficient.
Is there anyway to prevent this server-side?
Comments: No, this behavior is by design. The first time, the client script indicates to the server the size of the next transmitted file. The second time, it indicates to the server code, that the current file upload is completed. The third time, it indicates that all files in the queue were uploaded. This server code causes one additional postback to show preview images of the uploaded files.