2008-11-25

Auto Redirect to Login in page on an ASP.NET Website and keep styles

I have been working on an ASP.NET website recently and I ran into a problem where if I automatically redirected to the login page I lost my styles. I found a solution tho and here it is:
<!-- allows access Styles and Images directories-->
 <location path="Styles">
   <system.web>
     <authorization>
       <allow users="?">
     </allow></authorization>
   </system.web>
 </location>
 <location path="Images">
   <system.web>
     <authorization>
       <allow users="?">
     </allow></authorization>
   </system.web>
 </location>

<system.web>
   ...

   <authentication mode="Forms">
     <!-- When a user does not have access redirects to the login-->
     <forms loginUrl="Login.aspx" name="Login">
   </forms></authentication>
   <!-- Blocked access to all undecleared directores/files-->
   <authorization>
     <deny users="?">
   </deny></authorization>


   ...
</system.web>

2008-11-17

Pirates are not always cool

It turns out Pirates like games too so much so that they are stealing your consoles. Damn pirates!