Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Access to external javascript file denied

Thread Tools

Access to external javascript file denied

NZ Jimmy
Posts: n/a
I have a page in an ASP.NET web application that includes an external
javascript file using a fairly basic script tag:

<script src="DispatchRuleControl.js" type="text/javascript"></script>

When running the application on the ASP.NET internal webserver everything
works fine. When I try to host it on IIS7 however, access to the
DispatchRuleControl.js file is denied and the request for the js file results
in a redirect to the login page.

In the directory where the offending *.js file
is located, I have an ASP.NET web.config file that contains the following:

<allow roles="Administrator" />
<deny users="*" />

If I replace that <deny users="*" /> with a <deny users="?" /> then I can
get at the javascript file just fine. HOWEVER that also means that logged in
non administrative users can then access all of the files in this directory
(definitely not what I want).

If I leave <deny users="*" /> then when I'm logged in as an administrator I
can get at any *.aspx and *.ascx files in that directory, but not any *.js
files ???

Again, this ONLY happens when hosting the Web Application in IIS 7 - when
hosting on the Visual Studio internal web server everything runs fine.

Any ideas?


NOTE: I posted a similar thread in the IIS Security ng, but I'm becoming
more and more convinced this is an ASP.NET issue and not an IIS one... the
fact that the behaviour is altered by modifying settings in the
<authorization> section of the web.config are a definite clue...
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access denied in javascript when try to see contents of page in javascript opened window admyc Javascript 2 09-04-2007 12:29 AM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
A failure occurred writing to the resources file. Access is denied. -- RESX file is locked? -- WHY? Mark Kamoski ASP .Net 1 07-04-2003 12:02 PM