Skip to main content

Posts

Showing posts from March, 2011

ASP.NET custom forms authentication part 2

Did not receive any comment for Part 1 but going by the stats I think it has been useful for few of you. Thus I think I should Part 2. In this article we are going to  demonstrates how to set up custom forms authentication.  The login page assumes logging in using username and password (as demonstrated in Part 1 ).  The user roles for the site are stored in the database. For user identification I need userID and for authorization I need to know which group does user belong to. Wait a minute, ASP.NET provides way to handle it in web.config. like this:      <location path="Admin">     <system.web>       <authorization>         <allow roles="Admin"/>         <deny users="*"/>       </authorization>     </system.web>   </location>             But we are not using Membership Provider so how ASP.NET will come to know about it. There are two ways we can achieve this. One is to write a custom Mem

Date format problem with ASP.NET calendar and IIS

Today I was working on an existing ASP.NET application. The application is using an ASP.NET calendar control. We were creating a new environment for the testing team. The application was working fine but suddenly we realized there is some problem. The problem was with the date format. The expected date format was mm/dd/yyyy but we were getting mm-dd-yyyy (even after formating). I started working on this. First thing I thought was that it has something to do with the environment as the code is fine (as it is working fine on other machines). I googled a bit and found out that it is a common problem. So I thought about blogging about it in hope that it will help others. I found out that the problem is with the "Region and Language". For that go to control panel. You need to change the date format and the region as required. Now you need to restart the system.  Sometimes even after doing that you will not get the desired result. Then go to Administrative tab and