|
Rank: Newbie Groups: Member
Joined: 7/3/2007 Posts: 3
|
Do you have any full code (VB) examples for using your AJAXUploader control within a callbackpanel ?
I've tried a few thing myself without much success (stupidity on my part i'm assuming) - what I'm trying to achive is the upload of files (which works great) without a full page refresh (which I can't get working).
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
hi, johng Thanks for posting your question here. I have been trying to build an example for you on my own machine, but it seems something wrong with my vb.net in VS2005. Actually, all you need to do is to put your AJAXUploader into a callback panel, it should only update the content of callback panel. I tried it in C#, and I put a label control outside of the callback panel. In Page_Load, I set the text of the label to DateTime.Now.ToString(). When the file finished uploading, it has to post data back to server to let server fire the fileuploaded event, but only the data in callback panel will get updated. The text of label did not get changed. Please also see this post: http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=51Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Johng,
I looked further into the issue and noticed that actually our live demo project (You can find the source code on your local drive if you install our controls) actually uses AJAXUploader inside a CallbackPanel. In our live demo project, the main page contains a TreeView, and the demo region on the right side is inside a CallbackPanel and is always updated by an AJAX call.
Uploading a file using AJAXUploader is a two step process: first it uploads the file, and then the uploader or somebody else in the page raises a server event (which posts back the page). The first step does not refresh the whole page at all (That's why it is called AJAXUploader). The second step is necessary because once the upload is done, it needs to get back to the server side since it has to give your server code a chance to do something about the newly uploaded file ----otherwise the control would be useless.
When and how the second step is performed is in your hand. There are generally two ways to do this:
1. Set the AJAXUploader's AutoPostBack to true; 2. Use another button to submit the page;
In either case, identifying the control that triggers the server event (thus triggers the postback) is the key. Once you identify the control, you will need to set that control as a "Trigger" of the CallbackPanel control (right click the CallbackPanel control, then select "Edit Trigger").
Once you correctly set the trigger control, you should be able to upload file without a full page refresh.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 7/3/2007 Posts: 3
|
Hi - as per my first post, the problem actually was stupidity on my part. I was using another Ajax control (from Obout) for various other postbacks on the page. Obviously it's incompatible with your Ajax control.
I still need to use the functionality in the Obout control, so I now open another pop-up another window to make use of the AJAXUploder control and it works great.
Thanks for your help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad it works.
Feel free to let us know if you have more questions.
Thanks.
|
|