I'm trying to use AJAXControlToolKit to create a confirmation box that allows a user to upload a file. There's also an "OK" and a "Cancel" button on the confirmation box. For the most part it's all working, however I need to disable the "OK" button when the upload starts then reenable it when the upload is completed because allowing the user to press "OK" during upload throws an exception. I've already looked into setting the upload to start on the "OK" button click event but due to different instances of an argument this doesn't seem like an option.
This is the what builds the box when the event is called
protected void cnfUpload_Actioned(object sender, ConfirmationBoxEventArgs e)
e.ButtonStyle = ConfirmationBoxButtonStyle.AcknowledgeCancelUpload;
e.Message = "Select a WAV file to upload...";
e.Icon = ConfirmationBoxIcons.Information;
Session.Contents["UploadedFile"] = null;
Session.Contents["FileName"] = null;
This is the event where the upload takes place and where I'd like the disable and reenable the "OK" button.
protected void cbUpload_Uploaded(object sender, ConfirmationBoxEventArgs e)
//List View Upload - leads to edit
ConfirmationBox cb = sender as ConfirmationBox;
byte bFile = new byte[e.DataStream.Length];
e.DataStream.Read(bFile, 0, Convert.ToInt32(e.DataStream.Length));
//PromptData.SetAudio(Convert.ToInt32(cb.Reference), e.Filename, bFile);
Prompt.SetAudio(Convert.ToInt32(cb.Reference), e.Filename, AudioFile.ConvertToALaw(bFile));
SessionManager.UploadError = false;
catch (Exception ex)
SessionManager.UploadError = true;
diags.Error(Request, "Could not upload Temporary File", ex);
This is the code that builds the confirmation box on click of a button
<sso:ConfirmationBox ID="cbUpload" runat="server"
Reference='<%# Eval("ID") %>'
Apologies if I have not included enough information/code. But any help would be appreciated.