Mediante un Update Panel tengo un control el cual realiza la subida de la imagen al servidor almacenando una sesión y ejecuta un boton manualmente al terminar la consulta (Boton mismo el cual tiene una funcionalidad) esta consulta es para realizar cropping a una imagen la cual subimos previamente , el problema ocurre al darle click en el boton aceptar el cual realiza el corte de la imagen y la coloca en el panel debido , todo este codigo ya habia sido probado con otro control, el error de JS es el siguiente
Algún Script de esta página puede estar ocupado, o puede haber dejado de responder. Puedes detenerlo ahora, o esperar al fin de su ejecución.
Script: http://localhost:1526/Pegassus%20Project/ScriptResource.axd?d=Z40jKrvDduaI1HjXluA_cg13Zg4a8 GXsG35hd3XIZ0inoFJwRjmJL02zeB2zyieuDUblaPLwRmDu71l wNps64qqaPXE5aeonaO3d33xqYGVHaRsS61XXToKscSjYvTWrv r7Miu0_6ttGwkr1YTitsDPtYhbEu4pFhWlJvuRFcwU1&t=7c77 6dc1:194
Desconozco el por que y solo me ocurre en Firefox alguien tiene alguna idea??
Les agradezco
saludos.
Código HTML:
function UploadComplete() {
$("#tbn_CropDevices").trigger("click");
}
<asp:Panel ID="PanelInformation" runat="server">
<div class="containing" style="left: 0px; padding-left: 35px;">
<!--MY INFO--->
<h1 style="margin-top: 30px;">
<asp:Label ID="Label1" runat="server" Text="<%$ Resources: Message,lblMyInfo%>"></asp:Label></h1>
<div class="al" style="margin-right: 100px;">
<div class="picture">
<div class="marco" align="center" style="width: 185px; height: 140px; line-height: 128px;">
<asp:Image ID="Image3" runat="server" Style="position: relative; vertical-align:central; "></asp:Image>
</div>
<ajaxToolkit:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnClientUploadComplete="UploadComplete" OnUploadedComplete="AsyncFileUpload1_OnUploadedComplete" />
<asp:Button ID="tbn_CropDevices" runat="server" Style="display: none;width: 187px; margin-top: 5px; position: relative; height: 21px; left: 0px;" Text="<%$ Resources: Message,lblEditImageCrop%>" OnClick="tbn_CropDevices_OnClick"></asp:Button>
</div>
</div>
Código:
protected void tbn_CropDevices_OnClick(object sender, EventArgs e)
{
if (Session["FileNameInfo"] != null)
{
PanelInformationImage.Visible = true;
PanelInformation.Visible = false;
btnReadyImage.Enabled = true;
////////
System.Drawing.Image img = Bitmap.FromFile(Server.MapPath("~/Info/") + Session["FileNameInfo"].ToString());
ImageInfo.Width = img.Width;
ImageInfo.Height = img.Height;
if (img.Width > 1200 || img.Height > 354)
{
var ratioX = (double)1200 / img.Width;
var ratioY = (double)354 / img.Height;
var ratio = Math.Min(ratioX, ratioY);
//Obtener el tamaño de la imagen cargada
int newWidth = (int)(img.Width * ratio);
int newHeight = (int)(img.Height * ratio);
Bitmap bmp2 = new Bitmap(newWidth, newHeight, img.PixelFormat);
Graphics g2 = Graphics.FromImage(bmp2);
g2.DrawImage(img, 0, 0, newWidth, newHeight);
img.Dispose();
bmp2.Save(Server.MapPath("~/Info/") + Session["FileNameInfo"].ToString(), System.Drawing.Imaging.ImageFormat.Jpeg);
ImageInfo.Width = newWidth;
ImageInfo.Height = newHeight;
}
try
{
ImageInfo.ImageUrl = "~/Info/" + Session["FileNameInfo"].ToString();
}
catch (Exception)
{
throw;
}
ScriptManager.RegisterStartupScript(this, typeof(Page), "AplicaJcrop", "AplicaJcrop();", true);//rf3
}
}