Changing the URL of WebResource.axd

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 customer site is being proxied through another site. So the URL of the root of their site:

http://domain.com/somename/

Therefore, I need the WebResource.axd prefix with / somename so that the resulting tag looks like this:

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

What I'm not sure how to install it? Is there a web.config parameter that I can set to have this prefix?

+5
source share
3 answers

I think this function is Response.ApplyAppPathModifier ("You are the way"); can do your job.

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 this helps.

+2
source

, . , .

- . , (HttpFilter), "WebResource.axd" .

, - -, Referrer.

.

+1

/ "/WebResource" "WebResource" , ...

: URL- WebResource.axd

0

All Articles