|
Rank: Advanced Member Groups: Member
Joined: 4/13/2009 Posts: 37
|
I'm writing a simple web page for users to upload files, but before they can upload a file they have to select the final destination of the file. Is there a way to disable the Upload button on the AJAXUploader until I know a user has selected the destination?
Thanks, Marty
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The easiest way is to hide the entire AJAXUploader (by setting its Visible to false) instead of disabling it. If you do want to show the uploader but disable the upload button, you will need to customize the uploader's LayoutTemplate and replace the default Upload button with your own buttons (or any other HTML element, for example, an image). You would then handle the button's onclick event with JavaScript and call this function to start upload: http://doc.essentialobjects.com/library/1/jsdoc.public.ajaxuploader.upload.aspxSince it is your own button, you can disable/enable it based on whatever condition you would like. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 4/13/2009 Posts: 37
|
I've added a new HTML button (runat=server) to the content template and I'm able to upload a file. It works great! Except I can't figure out how to disable my HTML button. I thought that I would be able to grab it with something like:
this.AJAXUploader1.TemplateControl.FindControl("btnUpload2")
But this doesn't work. Any suggestions?
Thanks, Marty
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I believe you would simply use:
this.AJAXUploader1.FindControl("btnUpload2");
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 4/13/2009 Posts: 37
|
That's what I thought, but I get the following message:
AJAXUploader1.TempFileLocation can not be empty. While uploading, EO.Web AJAXUploader writes the uploaded contents into temporary files in that directory.
Using TemplateControl.FindControl("btnUpload2") returns null.
Thanks, Marty
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
That's something different. It tells you need to set AJAXUploader1.TempFileLocation. You need to set that property the first thing when using our uploader, regardless whether you use customized LayoutTemplate or not. Please see here for more information: http://doc.essentialobjects.com/library/1/ajaxuploader/prepare.aspx
|
|