Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader, cancel confirmation message Options
anddy
Posted: Monday, June 29, 2009 3:19:58 PM
Rank: Newbie
Groups: Member

Joined: 2/18/2009
Posts: 4
Is there a way to have the cancel button on the control popup a confirmation message to the user such as:

Are you sure you want to cancel the upload process?

I tried the following, but it does not seem to work:

<asp:Button ID="CancelButton" runat="server" Text="Cancel" OnClientClick="return confirm('Are you sure you want to cancel the upload process?');"></asp:Button>
eo_support
Posted: Monday, June 29, 2009 3:27:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try the following:

Code: HTML/ASPX
<input type="button" value="Cancel" onclick="confirm_cancel()" />


Code: JavaScript
function confirm_cancel()
{
    if (confirm('Are you sure?'))
    {
        //Get the client side AJAXUploader object. You will need
        //to change the "AJAXUploader1" to the ClientID of your
        //uploader control
        var uploader = eo_GetObject("AJAXUploader1");

        //Cancel the upload
        uploader.cancel();
    }
}


Note the code uses a regular HTML button so that by default the button does not trigger any action at all. The associated JavaScript code then handles the button's onclick event and when that is confirmed, it calls the uploader's client side JavaScript interface to cancel the upload.

Hope this helps.

Thanks!
anddy
Posted: Monday, June 29, 2009 4:13:39 PM
Rank: Newbie
Groups: Member

Joined: 2/18/2009
Posts: 4
Thank you, it worked
eo_support
Posted: Monday, June 29, 2009 4:18:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are welcome. Please feel free to let us know if you have any more questions.


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.