Hello there good people of StackOverflow, I recently needed to upload multiple images to CKeditor through an asp.net webform. Found a sample program and adapted it for my use and everything was going fine until one day I was told that when uploading three images in a row, IE would crash when trying to call the asp.net webform.
However, when using other browsers things work perfectly - as expected-.
Any thoughts on the matter?
I leave you with code snippets:
This is where I am calling the asp.net form
<script type="text/javascript">
window.onload = function () {
CKEDITOR.replace('<%=txtContent.ClientID %>', { baseHref: '<%= ResolveUrl("~/scripts/Editor/") %>', height: 400 });
CKEDITOR.replace('<%=txtContentAr.ClientID %>', { baseHref: '<%= ResolveUrl("~/scripts/Editor") %>', height: 400 });
CKEDITOR.on('dialogDefinition', function (ev) {
if (ev.data.name == 'image') {
var btn = ev.data.definition.getContents('info').get('browse');
btn.hidden = false;
alert("before the window call");
btn.onClick = function () { alert("inside the function call"); var ImageUploadWin = window.open('ImageBrowser.aspx', 'TheWindow', 'scrollbars=yes,width=780,height=630,left=' + ((screen.width - 780) / 2) + ',top=' + ((screen.height - 630) / 2) + ',resizable=yes,toolbar=no'); };
}
});
};
</script>
This is what asp.net form returns - if I am not mistaken -.
OkButton.OnClientClick = ("window.top.opener.CKEDITOR.dialog.getCurrent().setValueOf('info', 'txtUrl', encodeURI('" & ImageFolder) + ImageList.SelectedValue.Replace("'", "\'") & "')); window.top.close(); window.top.opener.focus();"
I believe the issue lays with how asp.net is returning the image - although I could be mistaken -.
Many thanks in advance for any hint/ideas/a gentle yet forceful push towards the solution