Reputation: 23
Spent Days trying to figure out why my ajaxFileUpload control was not firing the UploadComplete event and have finally discovered where it is coming from.
Whenever I try to use the uploader, I get a bizarre JS JSON error which was 'ungooglable'.
Anyway, through lots of testing it turns out the error is occurring because the parent user control (.ascx) has property Visible=false by default.
The parent user control is basically an ajax modal which contains a form + the fileuploader.
When the user clicks a button to show the form i set visible=true, then show the modal.
Is this good practice? and Since the ajaxfileupload seems to glitch out when I use that technique of loading the user control, is there another way to go about this without HAVING to load the form when the parent page is loaded?
Thank you for any help!
Upvotes: 0
Views: 273
Reputation: 896
If I understand your scenario correctly, this is acceptable practice.
What happens when you try to load anything with AjaxFileUpload is complete control lifecycle.
If a control is not visible for any reason then OnPreRender method, which contains valuable code for completing an upload, is not called.
I would say, that many Ajax Control Toolkit controls, including AjaxFileUpload, simply was not designed for scenarios that involve any visibility modification.
Upvotes: 1