I have an ASP.NET website.
I want users who are not logged in to be automatically (re)directed to the login page, for example,
~/Account/Login.aspx
I know it's many years later, but if anyone finds themself here you may be missing this bit in the webconfig. Within the tag you need to add this:
This tells the site that SecurePage.aspx requries the user to be logged in. This is how I've been doing it for a few years now