RadUpload Ajax call back error

Thread is closed for posting
15 posts, 1 answers
  1. restutw
    restutw avatar
    4 posts
    Member since:
    Aug 2007

    Posted 03 Jan 2008 Link to this post

    hi there,

         I put a RadUpload Prometheus(Q3) on the DNN module(.ascx). I have done the settings in web.config. It's can upload files, but it return an error message everytime when postback. The message is "RadUpload Ajax call back error. Source url returned invalided content:". The following of the error message is the page's html code. Is anything I need to set up to make this error disappeard?
         The code is what I write on the DNN module(.ascx):
    <telerik:RadProgressArea ID="RadProgressArea1" runat="server">
                            </telerik:RadProgressArea>
                            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" Skin="Web20" />
                            <telerik:RadUpload ID="RadUpload1" runat="server" Skin="Web20" InputSize="40" Width="420px"/>
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 03 Jan 2008 Link to this post

    Hi restutw,

    The code you sent us looks just fine. However, I believe that the most probable reason for your problem is in the Web.config file settings. The correct settings are:

    <httpHandlers>
              ... 
                <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI"/>
              
    </httpHandlers>
    <httpModules>
                <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>
               .....
    </httpModules>


    Please, note the bold text - this is different from the value stated in our documentation. So, please make sure you have the settings I pasted above in your project. We apologize for this temporary inconvenience and we have already fixed this so from next update there will be no differences between the documentation and the code.

    In case this does not solve your problem, please contact us again.

    Best wishes,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 03 Jan 2008 Link to this post

    I am having the exact same problem..
     
    My web.config is exactly like you listed here.

  4. restutw
    restutw avatar
    4 posts
    Member since:
    Aug 2007

    Posted 03 Jan 2008 Link to this post

    Hi there,

    My web.config is exactly like you listed here. So is there anything else need to set up? The error message is still exist...
  5. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 03 Jan 2008 Link to this post

    For what its worth, I switched the controls back to the classic version (and made the appropropriate changes to web.config) and it works fine.  There is something specific to the Prometheus version that isn't working properly.

    I have a sneakly feeling it's related to the URL rewriter that DNN uses but I'm not sure.  For example, I've also noticed that the Prometheus controls do not always skin properly if the DNN is running on an IIS subapplication (like "localhost/DNN/")
  6. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 04 Jan 2008 Link to this post

    Hi Jay Mathis,

    In case you use RadUpload "Prometheus" where the RadUploadProgressHandler has an ashx extension instead of aspx you should not add the RewriterRule in the SiteUrls.config file which is necessary in case you use the classic RadUpload. 

    I mean that if you use the classic RadUpload and you have a DNN URL rewriter (referred to as "friendly URLs"), you will need to exclude the RadUploadHttpModule. Otherwise DotNetNuke will intercept the request and you will see the portal default page instead of a progress area. Open the SiteUrls.config file from the DotNetNuke\Website folder in a text editor and add the following before the other <RewriterRule> tags:

    <RewriterRule>
        <LookFor>.*Telerik.RadUploadProgressHandler.aspx</LookFor>
        <SendTo>~/Telerik.RadUploadProgressHandler.aspx</SendTo>
    </RewriterRule>

    As far as it is concerned to RadUpload not always being skinned properly if the DNN is running on an IIS subapplication I suggest you check whether all WebResources are loaded correctly and whether something may prevent their proper functioning.

    Do not hesitate to contact us again if you need further assistance.

    Best wishes,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 04 Jan 2008 Link to this post

    I can confirm that I have set it up just as you specified and it is still not working.

    Here is my web.config:

    <
    httpModules>
    <
    add name="Compression" type="DotNetNuke.HttpModules.Compression.CompressionModule, DotNetNuke.HttpModules" />
    <
    add name="RequestFilter" type="DotNetNuke.HttpModules.RequestFilter.RequestFilterModule, DotNetNuke.HttpModules" />
    <
    add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />
    <
    add name="Exception" type="DotNetNuke.HttpModules.Exceptions.ExceptionModule, DotNetNuke.HttpModules" />
    <
    add name="UsersOnline" type="DotNetNuke.HttpModules.UsersOnline.UsersOnlineModule, DotNetNuke.HttpModules" />
    <
    add name="DNNMembership" type="DotNetNuke.HttpModules.Membership.MembershipModule, DotNetNuke.HttpModules" />
    <
    add name="Personalization" type="DotNetNuke.HttpModules.Personalization.PersonalizationModule, DotNetNuke.HttpModules" />
    <
    add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <
    add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>
    </
    httpModules>

    <
    httpHandlers>
    <
    add verb="*" path="*.captcha.aspx" type="DotNetNuke.UI.WebControls.CaptchaHandler, DotNetNuke" />
    <
    add verb="*" path="LinkClick.aspx" type="DotNetNuke.Services.FileSystem.FileServerHandler, DotNetNuke" />
    <
    add verb="*" path="RSS.aspx" type="DotNetNuke.Services.Syndication.RssHandler, DotNetNuke" />
    <
    add verb="*" path="Logoff.aspx" type="DotNetNuke.Services.Authentication.LogOffHandler, DotNetNuke" />
    <
    remove verb="*" path="*.asmx" />
    <
    add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <
    add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <
    add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
    <
    add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" />
    </
    httpHandlers>


    Here is my SiteURls.config:

    <?
    xml version="1.0" encoding="utf-8" ?>
    <
    RewriterConfig>
    <
    Rules>
    <
    RewriterRule>
    <
    LookFor>.*DesktopDefault.aspx(.*)</LookFor>
    <
    SendTo>~/Default.aspx$1</SendTo>
    </
    RewriterRule>
    <
    RewriterRule>
    <
    LookFor>.*EditModule.aspx(.*)</LookFor>
    <
    SendTo>~/Default.aspx$1</SendTo>
    </
    RewriterRule>
    <
    RewriterRule>
    <
    LookFor>.*/TabId/(\d+)(.*)/Logoff.aspx</LookFor>
    <
    SendTo>~/Admin/Security/Logoff.aspx?tabid=$1</SendTo>
    </
    RewriterRule>
    <
    RewriterRule>
    <
    LookFor>.*/TabId/(\d+)(.*)/rss.aspx</LookFor>
    <
    SendTo>~/rss.aspx?TabId=$1</SendTo>
    </
    RewriterRule>
    <
    RewriterRule>
    <
    LookFor>[^?]*/TabId/(\d+)(.*)</LookFor>
    <
    SendTo>~/Default.aspx?TabId=$1</SendTo>
    </
    RewriterRule>
    </
    Rules>
    </
    RewriterConfig>


    Here is the .ascx:

    <%
    @ Control Language="vb" AutoEventWireup="false" CodeFile="CandidateWebformUploadFiles.ascx.vb" Inherits="Lindquist.UI.CandidateWebForm2" %>
    <%
    @ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
    <%
    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 

    <
    div id="Lindquist">
    <asp:Label ID="lblMessage" runat="server"></asp:Label>
    <pIf you have a a resume or additional documents that you would like to include in your application, please attach them using the file upload utility below.  You may upload up to five (5) files of the following types: .doc, .docx, .pdf, .txt, .jpg</p

    <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="DeleteSelectedButton" InitialFileInputsCount="5" SkinsPath="~/controls/RadControls/Upload/Skins" /> 

    <
    telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> 

    <
    telerik:RadProgressArea ID="RadProgressArea1" runat="server"> </telerik:RadProgressArea

    <
    asp:ImageButton runat="server" ID="ibUpload" ImageUrl="images/upload_24.gif" /> 
    <asp:LinkButton runat="server" ID="cmdUpload">Upload files and finish</asp:LinkButton
    <dnn:CommandButton ID="cmdFinish" runat="server" CausesValidation="True" ImageUrl="images/save24.gif" Text="Finish without uploading files" />

    </
    div>

  8. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 04 Jan 2008 Link to this post

    Hi,

    Could you please request the RadUploadProgressHandler url in your web browser and let us know what is the result you observe? This information will give us a better idea of the problem and we will be able to think of a possible solution.

    Looking forward to receiving your reply.

    Best wishes,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 04 Jan 2008 Link to this post

    I typed the following into the browser URL
    http://localhost/DNN/Telerik.RadUploadProgressHandler.ashx


    This is what I got back:


    <>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://localhost/DNN/Telerik.RadUploadProgressHandler....

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

  10. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 08 Jan 2008 Link to this post

    Hi Jay Mathis,

    The result which you observe when you request RadUploadProgressHandler's url means that there is no problem with the progress handler's configuration. 

    We were able to reproduce the problem you experience with the code you have provided. It turns out to be necessary to add a RewriterRule in the SiteUrls.config which looks in the following way:

    <RewriterRule> 
       <LookFor>.*Telerik.RadUploadProgressHandler.ashx(.*)</LookFor> 
       <SendTo>~/Telerik.RadUploadProgressHandler.ashx$1</SendTo> 
    </RewriterRule> 
     

    Please, try to add the above suggested rewriter rule and test whether this will sole the problem you experience.

    If you have other questions do not hesitate to contact us again.
     
    Best regards,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 08 Jan 2008 Link to this post

    I followed your advise, but the result is still the same.  I still get the same error...
  12. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 09 Jan 2008 Link to this post

    Hi,

    Please, try to find the requested by the control RadUploadProgressHandler's url using Fiddler. Then check whether the rewriter rule is set correctly - whether It looks for the url  which you have found via Fiddler and whether it sends it to the real url of the progress handler (the one which I had asked you to request from your browser).

    Another way to fix the problem is to use the AjaxUrl property of the progress manger and to set the correct progress handler's url on Page_Load, for example:

    Me.RadProgressManager1.AjaxUrl = Page.ResolveUrl("~/Telerik.RadUploadProgressHandler.ashx"

    Please, let me know in case you need further assistance.

    All the best,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Jay Mathis
    Jay Mathis avatar
    28 posts
    Member since:
    Oct 2004

    Posted 09 Jan 2008 Link to this post

    I am not sure what you meant by using Fiddler or how to do that. 

    I checked and double checked the rewriter rules and everything looks correct, but still did not work.

    However, it did work when I set manually set the AjaxURL of the RadProgressManager as you suggested.

    Any clue as to why this has to be set manually?
  14. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 09 Jan 2008 Link to this post

    Hi,

    Here is a link where you can find detailed information about Fiddler as well as you can download it. Please, download Fiddler, run the dnn module containing the upload control and review the information about the Web Sessions in Fiddler and especially the RadUploadProgressHandler's url request. Please, check it and send the requested RadUploadProgressHandler's url to us.

    It is needed to set the RadUploadProgressHandler's url manually as it is searched in the folder in which your dnn module containing RadUpload is located and the handler itself is not located there but in the root of the application.

    Best wishes,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  15. Answer
    dc
    dc avatar
    2 posts
    Member since:
    May 2007

    Posted 20 Feb 2008 Link to this post

    This rule has to be first or you will still get the error

    <
    RewriterRule> 
       <LookFor>.*Telerik.RadUploadProgressHandler.ashx(.*)</LookFor> 
       <SendTo>~/Telerik.RadUploadProgressHandler.ashx$1</SendTo> 
    </RewriterRule> 
Back to Top