PC Review


Reply
Thread Tools Rate Thread

Access to external javascript file denied

 
 
NZ Jimmy
Guest
Posts: n/a
 
      24th Jun 2010
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:

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

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?

Jimmy

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
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 javascript error Jeremy Microsoft ASP .NET 3 21st Nov 2010 09:12 AM
How can I put this javascript in external .js file? Jeff Microsoft ASP .NET 5 10th Mar 2010 07:33 PM
JavaScript;resizeTo;Access denied;IFRAME HMEG Windows XP Internet Explorer 1 21st May 2004 11:09 AM
ASPNET account - Javascript 'Access Denied' error =?Utf-8?B?TWFyYyBNdWVsbGVy?= Microsoft Dot NET 0 8th Mar 2004 08:31 PM
'Access Denied' when using javascript to change page location Microsoft ASP .NET 1 8th Nov 2003 12:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 PM.