tags:

views:

56

answers:

1

I have this piece of code:

Page.ClientScript.RegisterClientScriptInclude(this.GetType(), Guid.NewGuid().ToString(), this.ResolveUrl("~/Scripts/min.js"));

When we push to our QA server - http://qa.example.com - it works just fine, but when we push to an address in the intranet - http://intranet/app - it won't find the script.

Any suggestions?

+1  A: 

You Intranet's root is http://intranet not http://intranet/app - your RegisterClientScriptInclude in is looking in http://intranet/scripts/min.js not http://intranet/app/scripts.

Adrian
Not really... when I look at the generated code, it looks like: <script src="/app/Scripts/min.js" type="text/javascript"></script>, so the reference is correct.
oz
Couple of ways to go then, 1, fire up Fiddler and examine why the request for /app/scripts/min.js fails, probably access denied or not found. 2. Manually construct the url in the address bar http://intranet/app/scripts/min.js -
Adrian
after typing the above - I will to place a small bet on it being permissions on the scripts folder, provided you actually copied the script over to the server!
Adrian
it was actually a permissions problem.. but it should give me an exception, not simply load the page without the scripts! thanks anyways!
oz
Browsers get 404 or 50x errors when they can't access a resource that the server cannot find or allow them to have.Servers do not push to the client, clients pull from the server. That's why asp.net did not throw an exception.
Adrian