FileNotFoundException

4 posts, 0 answers
  1. Julian Pirola
    Julian Pirola avatar
    4 posts
    Member since:
    Oct 2009

    Posted 14 Nov 2011 Link to this post

    Im using AsynUpload to upload a file, and an asp button to submit the the process of the file.
    <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
    <telerik:RadAsyncUpload ID="rauFileUpload" runat="server" Width="95%"
                            OnClientValidationFailed="validationFailed" 
                            AllowedFileExtensions="xls" 
                            MaxFileSize="4000000">
    </telerik:RadAsyncUpload>
    <br />
    <asp:button id="btnCharge" runat="server" OnClick="btnCharge_Click" /> 
    <br />
    <telerik:RadProgressArea runat="server" ID="RadProgressArea1" skin="Default" ProgressIndicators="TotalProgressBar, TotalProgressPercent">
    </telerik:RadProgressArea>

    The problem was when i double click on the button btnCharge i get the Exception
    Server Error in '/EPR' Application.
    --------------------------------------------------------------------------------
      
    Could not find file 'C:\RPG\01-NET\EPR\EPR\EPR\App_Data\RadUploadTemp\nt2njtqp.xhy'. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
      
    Exception Details: System.IO.FileNotFoundException: Could not find file 'C:\RPG\01-NET\EPR\EPR\EPR\App_Data\RadUploadTemp\nt2njtqp.xhy'.
      
    Source Error: 
      
      
    Line 70: 
    Line 71:             string fileName = Path.GetTempFileName();
    Line 72:             uf.SaveAs(fileName);
    Line 73:             
    Line 74:             //DataSet ds = HLPimportExcel.ImportExcel(fileName, Yes);
       
      
    Source File: c:\RPG\01-NET\EPR\EPR\EPR\Pages\HES\ServicesMassiveCharge.aspx.cs    Line: 72 
      
    Stack Trace: 
      
      
    [FileNotFoundException: Could not find file 'C:\RPG\01-NET\EPR\EPR\EPR\App_Data\RadUploadTemp\nt2njtqp.xhy'.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +305
       System.IO.File.Move(String sourceFileName, String destFileName) +239
       Telerik.Web.UI.AsyncUploadedFile.SaveAs(String fileName, Boolean overwrite) +81
       Telerik.Web.UI.UploadedFile.SaveAs(String fileName) +38
       Pages_HES_ServicesMassiveCharge.btnCharge_Click(Object sender, EventArgs e) in c:\RPG\01-NET\EPR\EPR\EPR\Pages\HES\ServicesMassiveCharge.aspx.cs:72
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
      
       
      
      
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5420

    I solve the problem with those double-click-on-buttons users with javasript, disabling the button and forcing a postback
            function enableLoadButton(button)
            {   
                button.disabled = true;
                  
                __doPostBack("<%= btnCharge.UniqueID %>");
                  
                return;
            }
      
    <asp:button id="btnCharge" runat="server" OnClick="btnCharge_Click" OnClientClick="enableLoadButton(this)" />

    Its solve the problem for some users, other still have the problem.
    I try the different configurations of the time persistens of the files and nothing. In some point the uploaded file dissapear and i get the exception.
    This occurs after the file was processed, when the response is created and i dont need to access to it anymore.

       Hope u can assist me, ask me if u need more info.
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 15 Nov 2011 Link to this post

    Hi Julian Pirola,

    I've transferred this forum post to a product feedback ticket.

    I am not able to reproduce the problem. Could you attach here a sample project where the issue is reproduced? We will take a look at what is going wrong then.

    Best wishes,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Julian Pirola
    Julian Pirola avatar
    4 posts
    Member since:
    Oct 2009

    Posted 16 Nov 2011 Link to this post

    Hi Genady Sergeev, the problem its that i cant reproduce it either, its just happen to 1 user, thats the weird thing.
    Ill post the entire code of the page, the .aspx and the .cs

    .aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServicesMassiveCharge.aspx.cs" Inherits="Pages_HES_ServicesMassiveCharge" EnableEventValidation="false" %>
    <%@ Register TagName="InformationBox" TagPrefix="ucInformation" Src="~/Pages/Common/GenericControls/InformationBox.ascx" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title>Services Massive Charge</title>
        <link rel= "stylesheet" href="../../App_Themes/Exiros/Styles.css" type="text/css" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
        <form id="form1" runat="server" class="TextForm">
        <telerik:RadScriptManager runat="server" ID="rsmMassiveCharge">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="rfdButtons" Skin="Default" runat="server" DecoratedControls="All" ControlsToSkip="Fieldset,Buttons"/>
        <script type="text/javascript">
          //<![CDATA[
            //Funcion que valida por extension y tamaño del archivo.
            function validationFailed(sender, eventArgs) 
            {
                var sMessage = '<%=Resources.EPR.XLS_InvalidExcel%>';
                sMessage = sMessage.replace('{exception}','<%=Resources.EPR.XLS_ExtensionSpace%>');
                $(".ValidationsErrors").append("<p>" + sMessage +"File :"+ eventArgs.get_fileName() + "</p>").fadeIn("slow");
            }
              
              
            //Al momento en que se activa el RadProgressArea desactivo el boton de carga.
            function enableLoadButton(button)
            {   
                button.disabled = true;
                  
                __doPostBack("<%= btnCharge.UniqueID %>");
                  
                return;
            }
          //]]> 
      
            function btnGetID_onclick()
            {
                var rcbADUsers = $find('<%= rcbADUsers.ClientID %>');
                var rtbUserID = $find('<%= rtbUserID.ClientID %>');
                  
                rtbUserID.set_value(rcbADUsers.get_value());
                  
                return;
            }
        </script>
        <div>
        <table id="tblExcel" width="100%" class="TableForm">
            <%--Titulo--%>
            <tr>
                <td id="gradient" colspan="5" class="TitleForm" style="height:25px;">
                     <asp:Label ID="Title" CssClass="Labels" runat="server" Text="<%=Resources.EPR.XLS_ChargeExcel%>"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <ucInformation:InformationBox ID="ibMassiveCharge" runat="server" />
                    <!-- Descarga de archivo modelo Excel -->
                    <table id="tblDownload" border="0" style="width:100%;" class="TableForm">
                        <tr>
                            <td align="center" valign="middle" style="width:35px;">
                                <img alt="Excel" src="../../Images/excel.png"  />
                            </td>
                            <td class="Labels" style="FONT: 12px/16px 'segoe ui',arial,sans-serif !important">
                                <asp:HyperLink ID="hlExcel" runat="server" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <ucInformation:InformationBox ID="ibADUsers" runat="server" />
                    <table cellpadding="2" cellspacing="0" width="100%" border="0" class="TableForm">
                        <tr>
                            <td style="width:10%; text-align:right;">
                                <asp:Label ID="lblADUsers" runat="server"
                                           CssClass="Labels" />
                            </td>
                            <td style="width:25%;">
                                <telerik:RadComboBox ID="rcbADUsers" runat="server"
                                                     Width="100%"
                                                     CausesValidation="false"
                                                     EnableLoadOnDemand="true"
                                                     AllowCustomText="false"
                                                     MarkFirstMatch="true"
                                                     ShowToggleImage="false">
                                    <WebServiceSettings Path="~/WebServices/UsersAD.asmx"
                                                        Method="GetUsersByName" /> 
                                    <FooterTemplate>
                                        <asp:Label ID="lblADFooter" runat="server"
                                                   CssClass="ComboBoxLabelFooter" />
                                    </FooterTemplate>                             
                                </telerik:RadComboBox>
                            </td>
                            <td style="width:65%;">
                                <input type="button" id="btnGetID"
                                       causesvalidation="false"
                                       value="<%= Resources.EPR.ST_MASSIVE_GetID %>"
                                       onclick="btnGetID_onclick()" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:right;">
                                <asp:Label ID="lblGetID" runat="server"
                                           CssClass="Labels" />
                            </td>
                            <td colspan="2">
                                <telerik:RadTextBox ID="rtbUserID" runat="server"
                                                    Width="10%"
                                                    ReadOnly="true" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <ucInformation:InformationBox ID="ibUploadFile" runat="server" />
                    <!-- Subida de archivo Excel -->
                    <table id="tblUpload" width="100%" border="0" class="TableForm">               
                        <tr>
                            <td>
                                <table id="tblUploadFile" border="0" style="width:100%; background-color:White;">
                                    <tr>        
                                        <td>  
                                            <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
                                            <telerik:RadAsyncUpload ID="rauFileUpload" runat="server" Width="95%"
                                                                    OnClientValidationFailed="validationFailed" 
                                                                    AllowedFileExtensions="xls" 
                                                                    MaxFileSize="4000000">
                                            </telerik:RadAsyncUpload>
                                            <br />
                                            <asp:button id="btnCharge" runat="server" OnClick="btnCharge_Click" OnClientClick="enableLoadButton(this)" /> 
                                            <br />
                                            <telerik:RadProgressArea runat="server" ID="RadProgressArea1" skin="Default" ProgressIndicators="TotalProgressBar, TotalProgressPercent">
                                            </telerik:RadProgressArea>                  
                                        </td>
                                    </tr
                                </table>   
                            </td>
                        </tr>     
                   </table>
                   <br />
               </td>
           </tr>
           <tr>
                <td>           
                    <!-- Validacion textos -->
                    <div class="ValidationsErrors" style=" margin-top:10px; margin-bottom:10px; display:none; width:100%;"></div>
      
                    <!-- Validación y mensajes de confirmación -->
                    <div id="infoMessageWindow" runat="server" style="display:none; margin-top:10px; margin-bottom:10px; display:none;"></div>
                </td>
           </tr>
        </table>
        </div>
        </form>
    </body>
    </html>

    .cs
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Globalization;
    using System.IO;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
      
    using Exiros.EPR.Frmk.Helpers;
    using Exiros.EPR.Bl.BussinesObjects;
    using Exiros.EPR.Bl.BussinesObjects.Enumerators;
    using Exiros.EPR.Bl.Facade;
    using Telerik.Web.UI;
    using System.Collections.Generic;
      
      
    public partial class Pages_HES_ServicesMassiveCharge : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Establecemos la cultura
            //System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("es");
            //System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es");
      
            //Configuro controles
            rauFileUpload.MaxFileInputsCount = 1;
            rauFileUpload.InitialFileInputsCount = 1;
            rauFileUpload.AutoAddFileInputs = true;
            rauFileUpload.OverwriteExistingFiles = true;
            rauFileUpload.Culture = System.Threading.Thread.CurrentThread.CurrentCulture;
      
            //Archivos de recursos
            this.Title.Text = Resources.EPR.XLS_ChargeExcel;
            this.ibMassiveCharge.HTMLText = Resources.EPR.XLS_Information;
            this.hlExcel.Text = Resources.EPR.XLS_DownloadExcel;
            this.hlExcel.NavigateUrl = "../../Pages/HES/ServiceMassiveChargeModels/ServiceMassiveChargeTemplate.aspx";
      
            this.ibADUsers.HTMLText = Resources.EPR.INFO_MASSIVECHARGE_UserQuery;
            this.ibUploadFile.HTMLText = Resources.EPR.INFO_MASSIVECHARGE_UploadFile;
            this.lblADUsers.Text = Resources.EPR.ST_MASSIVE_UserQuery + ":";
            this.lblGetID.Text = Resources.EPR.ST_EXCEL_Supplier + ":";
            this.rcbADUsers.EmptyMessage = Resources.EPR.AD_COMBOBOX_EmptyMessage;
            ((Label)this.rcbADUsers.Footer.FindControl("lblADFooter")).Text = Resources.EPR.AD_COMBOBOX_Footer.Replace("{adMaxResults}", HLPconstants.AD_MAX_RESULTS);
            this.btnCharge.Text = Resources.EPR.XLS_Load;
        }
      
        /// <summary>
        /// Click en el boton carga
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnCharge_Click(object sender, EventArgs e)
        {
            int i = 1;
            int iUploaded = 0;
      
            // Cantidad de archivos subidos
            iUploaded = rauFileUpload.UploadedFiles.Count;
      
            //Chequeo si subio el archivo
            if (iUploaded > 0)
            {
                UploadedFile uf = rauFileUpload.UploadedFiles[0];
                Supplier supplier = (Session[HLPconstants.SUPPLIER_LOGGED] as Supplier);
      
                string fileName = Path.GetTempFileName();
                uf.SaveAs(fileName);
                  
                //DataSet ds = HLPimportExcel.ImportExcel(fileName, Yes);
      
                //DataSet ds = HLPimportExcel.ImportExcel(((FileStream)uf.InputStream).Name); 
      
                DataSet ds = HLPimportExcel.ImportExcel(fileName);
      
                DataRowCollection rows = ds.Tables[0].Rows;
      
                IList<ServiceItemXls> servItemXlsList = new List<ServiceItemXls>();
      
                //Aplico un trapeo de exception por falla de formato de Excel
                try
                {
                    foreach (DataRow row in rows)
                    {
                        ServiceItemXls serviceItemXls = new ServiceItemXls();
      
                        serviceItemXls.ItemXls = i.ToString();
                        serviceItemXls.Charged = "X";
                        serviceItemXls.CiaSap = row[1].ToString().ToUpper().Length > 0 ? this.ParseSociety(row[1].ToString().ToUpper()) : String.Empty;
                        serviceItemXls.DestinationSap = String.Empty;
                        serviceItemXls.Mr = supplier.Mr.ToString();
                        serviceItemXls.SupplierSap = supplier.GetSupplierCodeByDestination(EnumDestination.Tenaris);
                        serviceItemXls.ApplicantAd = row[7].ToString().ToUpper();
                        serviceItemXls.CostCenterReq = row[8].ToString().ToUpper();
                        serviceItemXls.ServiceStartDate = HLPstring.ConvertFormatDateString(row[10].ToString(), "dd/MM/yyyy", "yyyyMMddHHmmss");
                        serviceItemXls.ServiceEndDate = HLPstring.ConvertFormatDateString(row[11].ToString(), "dd/MM/yyyy", "yyyyMMddHHmmss");
                        serviceItemXls.HeadText = row[12].ToString();
                        serviceItemXls.OrderNumber = row[2].ToString();
                        serviceItemXls.OrderPosNumber = row[3].ToString();
                        serviceItemXls.OrderServiceNumber = row[4].ToString();
                        serviceItemXls.Quantity = row[5].ToString();
                        serviceItemXls.PosText = row[6].ToString();
                        serviceItemXls.DocReferenceSupplier = row[9].ToString();
      
                        //Armo la coleccion de service ticket para los valores que no son nulos en el excel
                        if (!String.IsNullOrEmpty(serviceItemXls.CiaSap) || !String.IsNullOrEmpty(serviceItemXls.OrderNumber) || !String.IsNullOrEmpty(serviceItemXls.OrderPosNumber) ||
                            !String.IsNullOrEmpty(serviceItemXls.OrderServiceNumber) || !String.IsNullOrEmpty(serviceItemXls.Quantity) || !String.IsNullOrEmpty(serviceItemXls.PosText) ||
                            !String.IsNullOrEmpty(serviceItemXls.ApplicantAd) || !String.IsNullOrEmpty(serviceItemXls.CostCenterReq) || !String.IsNullOrEmpty(serviceItemXls.HeadText))
                        {
                            servItemXlsList.Add(serviceItemXls);
                        }
      
                        //Incremento el indice de los items
                        i++;
                    }
      
                    //Si hay datos
                    if (servItemXlsList.Count > 0)
                    {
                        //Activo la progress bar, solo simbolico
                        UpdateProgressContext();
                    }
                    else
                    {
                        Exception valid = new Exception(Resources.EPR.XLS_NoHaveData);
                        throw valid;
                    }
                }
                catch (Exception valid)
                {
      
                    string textResources = Resources.EPR.XLS_InvalidExcel;
                    textResources = textResources.Replace("{exception}", valid.Message);
      
                    //Armo el HTML
                    string sHTML = "<table id='tblInfoMessage' border='0' class='ValidationsErrors' style='width:100%;'>";
                    sHTML += "<tr><td align='center' valign='middle' style='width:35px;'><img alt='Error' src='../../Images/delete-24.png' /></td>";
                    sHTML += "<td>" + textResources + "</td></tr></table>";
      
                    //Asigno al div el html generado
                    infoMessageWindow.InnerHtml = sHTML;
                    infoMessageWindow.Attributes.Add("style", "display:''");
                    return;
                }
      
                try
                {
                    //Llamo al alta masiva de servicio
                    ServiceTicketFacade servTicketFacade = new ServiceTicketFacade();
                    IList<String> listServiceTicketResult = servTicketFacade.InsertMassiveServiceTicket(servItemXlsList);
      
                    //Genero string de confirmación de proceso.
                    string textResources = Resources.EPR.XLS_AcceptMessage;
                    textResources = textResources.Replace("{idVales}", listServiceTicketResult[1].ToString());
      
                    //Armo el HTML
                    string sHTML = "<table id='tblInfoMessage' border='0' class='ValidationsErrors' style='width:100%;'>";
                    sHTML += "<tr><td align='center' valign='middle' style='width:35px;'><img alt='Error' src='../../Images/accept-24.png' /></td>";
                    sHTML += "<td>" + textResources + "</td></tr></table>";
      
                    //Asigno al div el html generado
                    infoMessageWindow.InnerHtml = sHTML;
                    infoMessageWindow.Attributes.Add("style", "display:''");
      
                }
                //Cualquier error del lado Web la capturamos por aca
                catch (System.Web.HttpException ex)
                {
                    this.ShowWebException(ex);
                }
                catch (System.Net.WebException ex)
                {
                    this.ShowWebException(ex);
                }
      
                catch (Exception ex)
                {
                    //Exception
                    string textResources = String.Empty;
                    string keyText = HLPExceptions.FindException(ex);
                    Type type = typeof(Resources.EPR);
                    string[] arrKeyText = keyText.Split(new char[] { '|' });
                    const string excelErrorCode = "-10001";
                    const string amountExcede = "-10002";
                    string itemResource;
      
      
                    switch (arrKeyText[2])
                    {
                        //Errores al validar campos excel
                        case excelErrorCode:
      
                            //Reemplazo las claves y busco en el archivo de recursos para el titulo
                            if (!String.IsNullOrEmpty(arrKeyText[0]))
                            {
                                System.Resources.ResourceManager rm = new System.Resources.ResourceManager(type);
                                //Busco en el archivo de recursos
                                textResources = rm.GetString(arrKeyText[0], System.Threading.Thread.CurrentThread.CurrentCulture) + "<br>";
                            }
      
                            //Split por cada fila que contenga error
                            string[] excelRows = arrKeyText[1].Split(new char[] { ';' });
      
                            for (int er = 0; er < excelRows.Length; er++)
                            {
                                //split para obtener el numero de la fila y el nombre de las columnas
                                string[] rowNumber = excelRows[er].Split(new char[] { ':' });
      
                                //Busco el archivo de recurso y lo reemplazo por el numero de fila
                                if ((rowNumber.Length > 1) && (!String.IsNullOrEmpty(rowNumber[1])))
                                {
                                    string[] item = rowNumber[0].Split(new char[] { '&' });
                                    System.Resources.ResourceManager re = new System.Resources.ResourceManager(type);
                                    itemResource = re.GetString(item[0], System.Threading.Thread.CurrentThread.CurrentCulture);
                                    textResources += (itemResource.Replace("{value}", item[1]));
                                    textResources += " ";
                                }
      
                                for (int rn = 1; rn < rowNumber.Length; rn++)
                                {
                                    //split para obtener el nombre de cada columna
                                    string[] columnName = rowNumber[rn].Split(new char[] { '#' });
      
                                    //reemplazo de archivo de recurso por cada columna
                                    for (int cl = 0; cl < columnName.Length; cl++)
                                    {
                                        if (columnName[cl].ToString() != "")
                                        {
                                            System.Resources.ResourceManager res = new System.Resources.ResourceManager(type);
                                            textResources += res.GetString(columnName[cl], System.Threading.Thread.CurrentThread.CurrentCulture) + ", ";
                                        }
                                    }
                                }
                            }
                            //Borro la coma al final de cada item y le agrego un salto de linea
                            textResources = textResources.Substring(0, textResources.LastIndexOf(", "));
                            textResources += "<br>";
      
                            break;
      
      
                        //Errores al exceder el máximo de saldo indexado
                        case amountExcede:
      
                            //Reemplazo las claves y busco en el archivo de recursos para kel titulo
                            if (!String.IsNullOrEmpty(arrKeyText[0]))
                            {
                                System.Resources.ResourceManager rm = new System.Resources.ResourceManager(type);
                                //Busco en el archivo de recursos
                                textResources = rm.GetString(arrKeyText[0], System.Threading.Thread.CurrentThread.CurrentCulture) + "<br>";
                            }
      
                            //Split para obtener: Orden, Numero de orden y saldo
                            excelRows = arrKeyText[1].Split(new char[] { ';' });
      
                            //armo mensaje de error
                            textResources = Resources.EPR.POD_ExcedeAmount + "</br>" + Resources.EPR.POD_Orders + ":" + excelRows[0] + " " + Resources.EPR.POD_PositionAbr + ":" + excelRows[1] + " " + Resources.EPR.POD_SubtotalExcedeAmount + excelRows[2];
                            break;
      
      
                        // errores generales
                        default:
                            //Reemplazo las claves y busco en el archivo de recursos
                            if (!String.IsNullOrEmpty(arrKeyText[0]))
                            {
                                System.Resources.ResourceManager rm = new System.Resources.ResourceManager(type);
                                //Busco en el archivo de recursos
                                textResources = rm.GetString(arrKeyText[0], System.Threading.Thread.CurrentThread.CurrentCulture);
                            }
      
                            //Reemplazo los valores que vienen de tibco
                            if ((arrKeyText.Length > 1) && (!String.IsNullOrEmpty(arrKeyText[1])))
                            {
                                textResources = textResources.Replace("{value}", arrKeyText[1]);
                            }
                            break;
      
                    }
      
                    //Armo el HTML
                    string sHTML = "<table id='tblInfoMessage' border='0' class='ValidationsErrors' style='width:100%;'>";
                    sHTML += "<tr><td align='center' valign='middle' style='width:35px;'><img alt='Error' src='../../Images/delete-24.png' /></td>";
                    sHTML += "<td>" + textResources + "</td></tr></table>";
      
                    ////Asigno al div el html generado
                    infoMessageWindow.InnerHtml = sHTML;
                    infoMessageWindow.Attributes.Add("style", "display:''");
      
                }//catch
            }
            else
            {
                //Armo el HTML
                string sHTML = "<table id='tblInfoMessage' border='0' class='ValidationsErrors' style='width:100%;'>";
                sHTML += "<tr><td align='center' valign='middle' style='width:35px;'><img alt='Error' src='../../Images/delete-24.png' /></td>";
                sHTML += "<td>" + Resources.EPR.XLS_FileNotExists + " </td></tr></table>";
      
                //Asigno al div el html generado
                infoMessageWindow.InnerHtml = sHTML;
                infoMessageWindow.Attributes.Add("style", "display:''");
      
            }
        }
      
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ex"></param>
        private void ShowWebException(Exception ex)
        {
            //Armo el HTML
            string sHTML = "<table id='tblInfoMessage' border='0' class='ValidationsErrors' style='width:100%;'>";
            sHTML += "<tr><td align='center' valign='middle' style='width:35px;'><img alt='Error' src='../../Images/delete-24.png' /></td>";
            sHTML += "<td>Error: " + ex.Message + "<br><br>" + Resources.EPR.ST_EXCEL_ERROR_WEB + "</tr></table>";
      
            ////Asigno al div el html generado
            infoMessageWindow.InnerHtml = sHTML;
            infoMessageWindow.Attributes.Add("style", "display:''");
        }
          
      
      
        /// <summary>
        /// Rad progress area
        /// </summary>
        private void UpdateProgressContext()
        {
            int total = 100;
      
            RadProgressContext progress = RadProgressContext.Current;
            progress.Speed = "N/A";
      
            for (int i = 0; i < total; i++)
            {
                progress.PrimaryTotal = total;
                progress.PrimaryValue = i;
                progress.PrimaryPercent = i;
      
                if (!Response.IsClientConnected)
                {
                    //Cancel button was clicked or the browser was closed, so stop processing
                    break;
                }
      
                progress.TimeEstimated = (total - i) * 100;
                //Stall the current thread for 0.1 seconds
                System.Threading.Thread.Sleep(100);
            }
        }
        private String ParseSociety(string soc)
        {
            try
            {
                return soc.Substring(soc.IndexOf('[') + 1, soc.LastIndexOf(']') - soc.IndexOf('[') - 1);
            }
            catch (Exception)
            {
                return soc;
            }
        }
    }

    I attach the sreenshot of the error from the user.

     Hope u can help me, thanks a lot.
  4. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 21 Nov 2011 Link to this post

    Hello Julian,

    I wasn't able to run the provided sample code. To resolve the issue we need to know how to reproduce it locally.
    My suggestion is to remove the following code "__doPostBack("<%= btnCharge.UniqueID %>");" from the event handler, because the button will trigger a postback even without that line of code.
    After that change please ask your user to reproduce the issue.

    Greetings,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top