ASP.NET Login Page Styles
I have created a user login page and am using Forms Authentication. Users are required to log into the system to use it, there are no anon pages. When the go into the system and get automatically redirected to the login page though, they loose all styles on the page. It is as if the paths to all the css files is incorrect. For all other pages it is ok, just when automatically directed to login.aspx there is a problem. Has anyone else seen and fixed this problem.
The problem may come from the fact all your application (except login.aspx) is protected. So when the user is redirected to login.aspx there are other urls which are retrieved in an anonymous way. For instance, if the user tries to get "~/StyleSheets/default.css" then the web server will return an invisible unauthorized response.
You should try something like that in your web.config file:
<location path="StyleSheets" > <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location>
- → Function Undefined in Axios promise
- → React formatting dates with momentjs server side
- → AngularJS directive: "templateUrl" doesn't work while "template" works
- → how to add cannonical tag for ASPX .NET page
- → URL routing requires /Home/Page?page=1 instead of /Home/Page/1
- → ASP.NET routing w/ changing article name
- → NumericTextBox Loses Value using Html.TextBoxFor, not HTML
- → How to do Bundling of css & js files in Drupal
- → Does the fact that every page is reachable through www.example.com and www.example.com/index have any SEO impact?
- → How to add rich snippet in a website?
- → UrlRewriting does not work on server, but on localhost it works fine on asp.net?
- → Bootstrap Nav Collapse via Data Attributes Not Working