Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
i don't know how exactly to ask question but i will ask you the way i can best explain and i want to add an username and pwd to login to website and when username and pwd is correct it has to divert to other page else wrong error. but after loging in if we copy the url and next time if we want to login we can directly copy past the previous url only there is no need to login rite..?? but i want the user to login always i mean the redirected url if it is pasted directly the page should ask for username and pwd as we can see in facebook or google like websites

Share this answer

when you LogIn first time you will save UserID in session >>> ok

after that in every page must check for UserID is null or not
if (UserID == null)
// Check for Username and Password , next fill session
// Redirect to welcome page

so this code must repeated for all pages in website, so you have option that you can put previous code in BasePage and All pages in website inherits form BasePage

after namespace in every page we have :

PageName : Basepage
Share this answer
karthikh87 6-Mar-12 13:19pm    
ya sure i can add this and thanks for your help and please let me know where to put this code in the page i am sorry if i am poor in coding please help for this thanks in adv
you can achieve the solution by following SAKrukov suggested site , you have to implement Forms authentication in your application then only it is possible that you explained.
for more refer:[^][^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900