Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Upload > RadUpload Ajax callback error. Source url returned invalid content:
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered RadUpload Ajax callback error. Source url returned invalid content:

Feed from this thread
  • Posted on Jan 16, 2008 (permalink)

    Hi there!

    I've been search in the forum and can't found anything what can help out here.
    I got this error "RadUpload Ajax callback error. Source url returned invalid content:" when I'm using RadUpload and I've insert the module and handler code in web.config
    The error is popping up in a javascript AlertBox with a OK button.
    This is in NET1 and I'm using RadUpload 2.4.3.0

    Any ideas , please?

    /Thanks

  • Petya Petya admin's avatar

    Posted on Jan 16, 2008 (permalink)

    Hi Philip Saltskog,

    We are not sure why you experience this problem -  did it appear only now in version 2.4.3 - have you used any previous version and if yes did you have this problem then? Please, also try navigating in your project to /Telerik.RadUploadProgressHandler.aspx and see what result this browsing will give. Are you using any Url rewriting as this could also be a reason for your problem? Let us know how it goes.

    Best wishes,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Jan 16, 2008 (permalink)

    When I try to navigate to Telerik.RadUploadProgressHandler.aspx I get this.

    The XML page cannot be displayed

    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


    Invalid at the top level of the document. Error processing resource 'http://mediascreen.utv.tankbar.net/Telerik.RadUploadPr...

    var rawProgressData = {InProgress:false,RadProgressContextCustomCounters:false}; ^

    I upgrade from 2.3.2.0 and I've same problem there. That was the reason to the upgrade :)
    Can it be something in the security on the NT system folders and files? I've use this before with no problem.

    /Thanks

  • Posted on Jan 17, 2008 (permalink)

    I found why this get me an error.

    In web.config in httphandlers the Telerik need to be first. If I put it last I get an error which tell me that the handler is not registred in web.config

    Any ideas why?

    /Thanks

    <httpHandlers>

    <add verb="*" path="Telerik.RadUploadProgressHandler.aspx" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload" />

    <add verb="*" path="tbimage.aspx" type="RenderUtils.HttpImageHandler, RenderUtils"/>

    <add verb="*" path="*.aspx" type="clsHttpHandler.HttpXmlHandler, clsHttpHandler"/>

    </httpHandlers>

  • Petya Petya admin's avatar

    Posted on Jan 17, 2008 (permalink)

    Hi Philip Saltskog,

    The information you see when you navigate to the Telerik.RadUploadProgressHandler.aspx is correct. The problem in your Web.config file came from this handler:

    <add verb="*" path="*.aspx" type="clsHttpHandler.HttpXmlHandler, clsHttpHandler"/>

    Because of path="*.aspx" this handler is actually registered for every .aspx file. However,
    RadUploadProgressHandler is also an aspx - Telerik.RadUploadProgressHandler.aspx
    and thus the request for
    Telerik.RadUploadProgressHandler.aspx will be handled by the wrong handler - clsHttpHandler.HttpXmlHandler. The order in which you register the handlers in Web.config thus becomes extremely important - if you place Telerik handler last, then the HttpXmlhandler will be found before that and all .aspx requests including the ones for Telerik.RadUploadProgressHandler.aspx will be handled by HttpXmlhandler and RadUpload will not work. You need to place the Telerik handler as the first.

    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Martin Kutter avatar

    Posted on Jan 17, 2008 (permalink)

    Hi,

    I get the same error as Philip but only when the session times out on the server:
    I have a web page with 6 RadUpload controls in it; that's 6 controls with each one file upload, not 1 control with 6 file uploads. Now I leave the page for about 20 minutes in order to reach a time out from the server. When I get back and try to upload, as soon as I click on the button, I get a javascript alert saying: Rad control Ajax callback error. Source url returned invalid content:..." and then I get a dump of the html source code in the same alert window.

    I understand that when the javascript code tries to call the server in order to upload the files, the session has timed out and the server returns an error. Is there a way to (some javascript code) to check if there is a timeout and display a more friendly message? or maybe redirect to the login page directly?

    Thanks.

  • Petya Petya admin's avatar

    Posted on Jan 18, 2008 (permalink)

    Hi Martin Kutter,

    The only suggestion we could give you is to override the JavaScript method that alerts this message and display a more suitable one by placing this script on your page somewhere after RadProgressManager's declaration:

    <script type="text/javascript">
            RadUploadNameSpace.RadProgressManager.prototype.ShowInvalidContentMessage = function()
            {
                alert("more suitable message");
            }
    </script>

    Hope this helps.

    All the best,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Martin Kutter avatar

    Posted on Jan 21, 2008 (permalink)

    Hello,

    Thanks for the tip, it works well. I, now, have a different problem related to the script you have sent, here is the situation (a bit long):

    All the pages of the website derive from one master page. On the pages that use the RadUpload control, I have placed multiview controls to show/hide the RadUpload controls depending on user clicks. I have placed the script you sent in the master page code so that it would be present in all the pages. This works fine when the RadUpload controls are displayed in the page, however I get a javascript error when no RadUpload control is there. This is to say that when the multiview control's index is set to show the view where the RadUpload control is located, everything is fine, but when the view index is not at a view that contrains any RadUpload controls, the javascript error occurs. The error says that RadUploadNameSpace is not defined and this is understandable if no RadUpload control code is generated by the server in the HTML page. To remedy this problem, I thought that the best way is to inject the script in the page code only when the RadUpload controls will be shown. For that, I have used the ClientScript.RegisterClientScriptBlock(...) method.
    The results I got are not exactly what I expected. When no RadUpload controls were displayed on the page, the script was not injected, which is what I want; but then, when the RadUpload controls were to be displayed, I got the same javascript error. I checked the source of the page and saw that the script I injected is there.

    So my question is now, why is there an error?? A guess would be that the location of the script in the page is not the same, could that be a source of error? When I use the RegisterClientScriptBlock method, the script is placed before the RadUpload controls code, while when the script used to be in the master page, it was placed at the end of the document, after the /body tag. If this positioning is the source of error, could you please tell me if there is a way to inject code at the end of the page? or at least after the RadUpload controls have been declared?

    Thank you for your help.

  • Sophy Sophy admin's avatar

    Posted on Jan 21, 2008 (permalink)

    Hi,

    Thank you for the detailed description of the problem.

    The script we have provided in our previous reply should be declared after the upload control. The problem you experience is most probably due to the position of the script on the page. To register the script at the end of the page server-side I suggest using ClientScript.RegisterStartupScript(...) .

    Please, let us know if you need further assistance.

    Best wishes,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Martin Kutter avatar

    Posted on Jan 22, 2008 (permalink)

    Hi!

    Everything works fine now. Thanks!

  • DarioM avatar

    Posted on Feb 14, 2008 (permalink)

    Hi there

    I'm also experiencing  the error in a script alert Dialog box that reads "Cannot find RadUploadHttpModule.Did you register the RadUploadHttpModule?If you do not register the HttpModule you cannot benefit from RadMemoryOptimization and RadProgressArea.Please, see the help for more details: RadUpload - Using RadUpload - Configuration - RadUploadHttpModule."

    I'm using the standard input files to upload files to my WebSite

    I have registered the httpModules and httpHandlers in the Web Config, I can upload the files and I can access the uploaded files in server side environment, but the message persists even when all works as I want.

    How can I stop this error message from showing?please help.

  • Sophy Sophy admin's avatar

    Posted on Feb 14, 2008 (permalink)

    Hi,

    Thank you for contacting us.

    I am not sure what may be the reason for experiencing the problem. Could you please send me a simple working application which reproduces the problem including the web.config file you use so that I can take a look at it, test it locally and research the problem? I will be glad to help you.

    I suggest you also refer to the Ajax Callback Error KB article which lists the most often reasons for experiencing the error and its resolutions. You can check whether any of the pointed problems fits your case.

    Looking forward to receiving your reply.

    All the best,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • DarioM avatar

    Posted on Feb 20, 2008 (permalink)

    Hi Sophia

    I have tried to isolate the page that I do the uploads in from the main application to a test application, because the application is big in size.

    The problem with this is: I don’t see the controls on the test application I get the error straight away.

    Can you please check the code and let me know what I’m doing wrong.

    I have attached the TestWebApp to  and send to support@telerik.com.

    Regards
    Desmond

  • Sophy Sophy admin's avatar

    Posted on Feb 20, 2008 (permalink)

    Hi,

    Could you please send us again a simple running project to support@telerik.com referencing ID-116974 in the subject line? When we receive it we will do our best to help you ASAP.

    We checked your account and noticed that you have not downloaded any version of RadControls from our site. Still, it seems that you have been using several Telerik controls for some time now. Since it is our policy to support only registered users, could you please share how you obtained our products? Maybe you downloaded them under a different account. If so, please share it with us so we can update our records and provide you with adequate services.

    As soon as I get your reply, I will evaluate your standing and will address your questions in the support ticketing system, as necessary.

    We will appreciate your feedback on this matter.

    Best wishes,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Sep 22, 2008 (permalink)

    i find i get the source url error when the file being uploaded has an apostrophe in the filename...does anyone have filtering ideas on that?

  • Posted on Sep 24, 2008 (permalink)

    Hey Bruce,

    I remember I had this problem before too. My projects now use the latest rad version I didn't get this...

    Cheers,
    Blaize

  • Sumeet avatar

    Posted on May 25, 2009 (permalink)

    Hi,

    I was getting the same error and i found some elements missing in my webconfig.
    So may be you can try this also.
    add these two handlers in your web.config.
    <httpHandlers>
    <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" />
    </httpHandlers>

    <handlers>
    <add name="Telerik.RadUploadProgressHandler.ashx_*" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode,runtimeVersionv2.0" /></handlers>

  • Ken Jones avatar

    Posted on Oct 21, 2009 (permalink)

    Hello,

    I am having the same issues after session timeout with the RadUploadManager. I have used the javascript code that was suggested as below but I then get a JScript runtime error saying RadUploadNameSpace is undefined. If I replace RadUploadNameSpace with the NameSpace relevant to my aspx page then I get a JScript runtime error saying MyNameSpace.RadProgressManager is null or not an object.

    <script type="text/javascript">  
            RadUploadNameSpace.RadProgressManager.prototype.ShowInvalidContentMessage = function()  
            {  
                alert("more suitable message");  
            }  
    </script> 

    Any ideas?

    Thanks,

    Ken Jones

  • Genady Sergeev Genady Sergeev admin's avatar

    Posted on Oct 21, 2009 (permalink)

    Hi Ken Jones,

    Please, place the aforementioned code after the RadUpload declaration. Example:

    <rad:RadUpload runat="server" ID="ImportFiles" TargetFolder="~/uploads" />
     
    <script type="text/javascript">
        RadUploadNameSpace.RadProgressManager.prototype.ShowInvalidContentMessage = function() {
            alert("more suitable message");
        
    </script>


    Regards,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  • Richard avatar

    Posted on Dec 6, 2010 (permalink)

    Hi Genady,

    Thanks for that answer, but I notice from the javascript call that it is specific to this control.  Is there a generic hook to any Telerik control suffering from the same problem?  Most of our controls are from the Telerik suite, and when a timeout occurs, almost any link will cause this error to occur.

    Thanks for any advice,

    Richard

  • Posted on May 17, 2011 (permalink)

    Thanks Sumeet, your suggestion solved my problem.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Upload > RadUpload Ajax callback error. Source url returned invalid content: