Dear all,
I'm building a Sharepoint 2010 website using AsyncFileUpload control from AjaxControlToolkit.
I've followed the install guide from http://www.jondack.com/index.php/2010/10/28/using-the-ajax-control-toolkit-with-sharepoint-2010/.
Everything work perfectly on my dev environment: Sharepoint 2010 on Windows 7 Ultimate.
But when I move the website to Sharepoint 2010 on Windows Server 2012, error happens.
Here is my code behind
protected void UploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
if (AsyncFileUpload1.HasFile)
{
ShowPhoto(AsyncFileUpload1.FileBytes);
}
}
private void ShowPhoto(byte[] photoData)
{
if (photoData == null) return;
var base64String = Convert.ToBase64String(photoData, 0, photoData.Length);
var s = "top.$get(\"" + imgPhoto.ClientID + "\").src = '" +"data:image/png;base64," +
base64String + "';";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "image", s, true);
}Here my aspx code
<script type="text/javascript">
function loadImage() {
document.getElementById('<%= imgPhoto.ClientID %>').src = '/loading.gif';
}
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:AsyncFileUpload ID="AsyncFileUpload1" OnClientUploadStarted="loadImage" OnUploadedComplete="UploadComplete" runat="server" /><asp:Image ID="imgPhoto" runat="server" /></ContentTemplate></asp:UpdatePanel>
When I select a photo, the webpage take a long time before show error message as below

When I debug and set break point to method UploadComplete, the debugger jump into the method many times and then break.
I'm facing the error for several days. Please help me.
Thanks.
Regards.