tags:

views:

306

answers:

2

ASP.NET automatically includes the following script tag:

<script src="/WebResource.axd?d=8H_C0aee9xE8e9a-3YoRhA2&amp;t=633413907763620168" type="text/javascript"></script>

However the clients site is being proxied through another site. So the URL to the root of their site is:

http://domain.com/somename/

So I need to prefix the WebResource.axd with /somename so the resulting tag will look like this:

<script src="/somename/WebResource.axd?d=8H_C0aee9xE8e9a-3YoRhA2&amp;t=633413907763620168" type="text/javascript"></script>

What I am not sure is how to actually set this? Is there a web.config setting I can set so it has this prefix?

+2  A: 

Dear Michael

I think that this function Response.ApplyAppPathModifier("You path"); can make the work for you.

on Global.asax

protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
   string HereIsMyFileName = HttpContext.Current.Request.RawUrl;

   if HereIsMyFileName contains the "webresource.axd"
     then change it to what ever you like using
        Response.ApplyAppPathModifier("You path");

Hope that this helps.

Aristos
+1  A: 

Well, you're pretty much screwed here. Reflector reveals with all certainty that this is hard-coded and cannot be changed.

Your only option is to find a workaround. For example, you can create a filter (HttpFilter) that would replace "WebResource.axd" with appropriate address.

Another thing I can think of - if you control the proxy server, you could have it filter out such requests and redirect them appropriately based on Referrer.

Good luck.

Fyodor Soikin