validationFailed handler not working

2 posts, 0 answers
  1. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 24 Feb 2012 Link to this post

    I am trying to get jquery to handle the delivery of a message if the user tries to upload a file that is open. I am using the sample from here to work with. I know I must have missed something because the example from the link does what I want it to do but I am getting the script errors from below from my page.

    Microsoft JScript runtime error: Exception thrown and not caught
    Microsoft JScript runtime error: Unhandled Error in Silverlight Application [ScriptObject_InvokeFailed]

    confusing because this is not a silverlight application but an ASP.NET

    here is my client side code from the .ascx file.

    <telerik:RadCodeBlock ID="RadFileUploadCodeBlock" runat="server">
     
        <script type="text/javascript">
            //<![CDATA[
            function validationFailed(sender, eventArgs) {
                $(".ErrorHolder").append("<p>Validation failed for '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
            }
            function closeDataContainer() {
                $('div[id$=datacontainer]').hide('slow');
            }
            //]]>
        </script>
     
    </telerik:RadCodeBlock>
     
     
    <div id="container">
        <div id="content-container">
            <div id="content">
                <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
                <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" MultipleFileSelection="Disabled"
                    OnClientValidationFailed="validationFailed" AllowedFileExtensions="xls, xlsx"
                    AutoAddFileInputs="True" Height="25px" Width="250px">
                    <FileFilters>
                        <telerik:FileFilter Description="*.xls; *. xlsx" Extensions="xls, xlsx"></telerik:FileFilter>
                    </FileFilters>
                </telerik:RadAsyncUpload>
                Select files to upload (xls, xlsx)
            </div>
            <div id="aside">
                <asp:Button runat="server" ID="BtnSubmit" Text="Process File" OnClick="BtnSubmit_OnClick" />
            </div>
            <telerik:RadProgressArea runat="server" ID="RadProgressArea1" Width="582px">
            </telerik:RadProgressArea>
            <div id="Div1">
                <asp:PlaceHolder ID="MessagePlaceHolder" Visible="false" runat="server"></asp:PlaceHolder>
            </div>
            <!-- this is used for client side delivery of AsyncUpload Failure messages -->
            <div class="ErrorHolder">
            </div>
        </div>
    </div>


  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 29 Feb 2012 Link to this post

    Hello Tim,

     
    One of the RadAsyncUpload's upload modes uses Silverlight. You can disable it by setting the DisablePlugins="true" property.

    Please find attached a sample project. If you still experience the issue, could you please modify the test project so I can see the error locally?

    Hope this will be helpful.

    Greetings,
    Plamen Zdravkov
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top