WebResource.axd link tag generated with bad href value

6 posts, 0 answers
  1. Jan Gittelman
    Jan Gittelman avatar
    3 posts
    Member since:
    Sep 2008

    Posted 24 Mar 2009 Link to this post

    My web site uses the Telerik Grid. The site code works perfectly on my unsecured webservers. However, when it's put on a secured server, I run into the following problem:

    The link and script tag references to WebResource.axd have an incorrect href (or src) value:
    <link href="/iLink/WebResource.axd?d=uvyg0lEHvdVutuaoo2LwYRzRjv037l4hYuYKa6mpQChmtUuj0NatJLGgOqrfypgB0&amp;t=633713242306327176" type="text/css" rel="stylesheet" class="Telerik_stylesheet" />

    Instead of iLink, the href should be /swh_us_win_s/iLink/WebResource.axd

    I understand why its being generated incorrectly. The client talks to a proxy (https:..../swh_us_win_s/iLink) and the proxy redirects to the webserver (https:.../iLink). The webserver itself only knows about iLink, so if it's generating the path based on the server, iLink is what I'd expect. I've had to deal with this issue in the web app too. In the webapp, we set a web.config tag with the actual base url and then use it to generate the client side redirects, etc.

    Anyone know a way to override what is being generated?
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Mar 2009 Link to this post

    Hi Jan Gittelman,

    You could try using the HttpHandlerUrl property to override the default path of the handler.

    I hope this helps,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jan Gittelman
    Jan Gittelman avatar
    3 posts
    Member since:
    Sep 2008

    Posted 25 Mar 2009 Link to this post

    I'm not quite up to speed on this, but doesn't the handler get called when the client makes a request for the code/stylesheet in the WebResource file? If so, this won't work, since the tag got generated with the wrong URL.
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Mar 2009 Link to this post

    Hi Jan Gittelman,

    From the generated urls it seems that you are not using RadStyleSheetManager or RadScriptManager. The WebResource.axd http handler is internal to ASP.NET and as far as I know the path cannot be changed.

    If you decide to use RadScriptManager or RadStyleSheetManager the HttpHandlerUrl property would help you to override the path to the http handler. If this does not work I suggest you disable embedded resources. This is described in this help article. That way those HTTP handler urls will never be generated from our controls.


    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Jan Gittelman
    Jan Gittelman avatar
    3 posts
    Member since:
    Sep 2008

    Posted 26 Mar 2009 Link to this post

    Actually, I am using the RadScriptManager (and RadSheetManager).  It appears that the RadScriptManager does NOT allow the use of httphandlers with Absolute paths. And, that is what's needed to get teh secure server to generate the correct href/src tag value. As a test, I commented out code in the ScriptManager.cs and RadStyleSheetManager.cs that kept the httphandlerurl from being an absolute path in the HttpHandlerUrl set property and the prerender event and setup the HttpHandler forTelerik.Web.UI.WebResource.axd to have an absolute URL. This worked great in that the <link> and <script> tags had the valid href/src values.

    However, the grid apparently generates some link and script tags outside of the script and stylesheet manager, so those tags still didn't have the correct attribute values.  Am now investigating the generation of these tags.

    Anyone know what's bad about specifying an absolute URL for the ScriptManager HttpHandler?

  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 26 Mar 2009 Link to this post

    Hello Jan Gittelman,

    Those tags are most probably references to static resources such as background images from the skin. They are using the built-in WebResource.axd handler for which we cannot change the rendered url no matter how hard we try. Perhaps the only workaround for your scenario is disabling embedded resources - both skins and javascript files. Then all resources will be served as static files.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017