simple login page in ASP.net

i am sharing an easy way to make simple login page, its easy and simple just follow the steps.
1.open visual studio
2.file->new->website.
3.from options select ASP.net website and give name to the website and press ok.
4.Now in solution explorer rename Default.aspx to login.aspx
5.Or if you want you can add a new page.
6.Now from options above select Website and then select ASP.Net configuration.

7.you will get above window.Now select Security from it.

8.you will get above window.now you can define roles of the user by pressing "enable roles" and you can create roles.
9.then you can add users by clicking "select authentication type",when you click it you will get a window as below

10.then select "from the internet" and you will go back to security page ,from there select "create user" and you will go to a form where you have to fill user details such as username,password etc.You can assign roles to the users that you had defined before.
11.when you are done then close your browser,and return to visual studio,now in "toolbox" under "Login" select "Login" and drop it on the page.(as shown below)

12.just run it and you are done
13.or you can add extra things such as whenever there is successful login you go to a specific page,for this you have to select "DestinationpageUrl" in "properties" and give the address of a page where you want to go.
14.Then you can add that when you signIn page shows username,for this drag "LoginName" in the tool box to the page,and it will show you the username that is currently signedIn
i hope that this will be useful for you ppl :)..

0 comments:

Post a Comment