This is a migrated thread and some comments may be shown as answers.

WebResource.axd link tag generated with bad href value

5 Answers 304 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Jan Gittelman
Top achievements
Rank 1
Jan Gittelman asked on 24 Mar 2009, 06:40 PM
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?

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 25 Mar 2009, 02:01 PM
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.
0
Jan Gittelman
Top achievements
Rank 1
answered on 25 Mar 2009, 04:57 PM
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.
0
Atanas Korchev
Telerik team
answered on 25 Mar 2009, 05:34 PM
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.
0
Jan Gittelman
Top achievements
Rank 1
answered on 26 Mar 2009, 12:57 PM
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?

0
Atanas Korchev
Telerik team
answered on 26 Mar 2009, 01:02 PM
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.
Tags
ScriptManager and StyleSheetManager
Asked by
Jan Gittelman
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jan Gittelman
Top achievements
Rank 1
Share this question
or