I am using forms authentication, and when the user is not authenticated he automatically gets sent to:
login.aspx?ReturnUrl=%2fWebForm1.aspx
When this happens, I cannot load any javascript or css. Instead of GET’ing
Resources/myScript.js
it seems to be GET’ing
login.aspx?ReturnUrl=%2fResources%2fmyScript.js
This obviously causes some problems. And I don’t know how to solve it…
Edit: I include the script in <head> like this:
<script type="text/javascript" src="Resources/myScript.js"></script>
You need to exclude your css and javascript files from authentication.
Add this in your web.config where css is the path to your css files (do the same for your javascript files)