Welcome Guest Search | Active Topics | Sign In | Register

Callback Panel & asp:FileUpload in asp:Wizard Options
Jason S
Posted: Wednesday, July 25, 2007 1:24:42 PM
Rank: Member
Groups: Member

Joined: 5/30/2007
Posts: 23
Hello,

I am using a CallbackPanel within an asp:Wizard. On one of the wizard steps, I have an <asp:FileUpload> control for uploading an image. I would like to do this via callback, but the CallbackPanel posts back everything except for the <asp:FileUpload> controls.

I saw another post with something similar with a datagrid view I think it was, but my situation is somewhat different. I have set the from enctype="multipart/form-data", but the page is still not posting back the file element. I have looked at the AJAXUploader and while it looks like a great control , unfortunately it is not quite right for what I need on the page.

Any info would be helpful.

Thanks in advance,
Jasond'oh!
eo_support
Posted: Wednesday, July 25, 2007 1:57:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi Jason,

Thanks for posting your question here. Unfortunately it's impossible to "ajax" file upload along with other page contents at the same time. A regular AJAX solution does a http form post and it can only deal with regular form data item, not file upload. Having enctype="multipart/form-data" is a must for uploading files, but still the CallbackPanel has to actually encode and upload the file contents, which obviously is beyond the ability of javascript code because of security concerns.

We have a separate component, AJAXUploader that deals with file uploading. The uploader would give you live progress information as it upload the files, and once it's done uploading, you can then submit the uploaded file list to the server and then your server code can decide how to deal with the uploaded files. The component is quite useful, especially for uploading large files. However it does not overcome the impossible of "AJAX posting the file and form content at the same time", the actual uploading is a two step process. AJAXUploader however can automatically triggers posting back (the second step) after it's done file uploading (the first step).

Our online sample demonstrates how to use AJAXUploader and CallbackPanel together:

http://www.essentialobjects.com/Demo/Default.aspx?path=AJAXUploader

You can pick any of the demo from the TreeView. The right side is always updated by a CallbackPanel, and some of the demos also use additional CallbackPanels inside the demo region.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks
Jason S
Posted: Wednesday, July 25, 2007 6:45:15 PM
Rank: Member
Groups: Member

Joined: 5/30/2007
Posts: 23
Thanks for the quick response!

I was a bit hasty in saying that the AJAXUploader woudln't suit my purposes, I just had not toyed with it enough. It looks like it work will work just fine.

Thanks again,
Jason


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.