|
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>
|
|
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!
|
|
Rank: Newbie Groups: Member
Joined: 2/18/2009 Posts: 4
|
Thank you, it worked
|
|
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.
|
|