asp.net中的登录页面错误

问题描述:

我通常在asp.net中创建一个登录页面,它需要用户名和密码.
我希望如果某人是第一次登录,则应该转到页面(假设completeInfo.aspx),如果用户第二次或更多次登录,则应该转到另一个页面(假设Details.aspx).我应该在登录按钮上写的代码

I am making a login page in asp.net as normally it takes username and password.
I want that if someone is logging in for the first time it should go to page(suppose completeInfo.aspx), if user is logging for the second or more than that time he should go to another page(suppose Details.aspx).What code i should write on Login button

您正在使用HTTP协议,该协议的状态较少,并且不能为下一次调用存储任何内容

在这里您可以选择以下两种方式之一:
1)使用数据库并在用户首次登录后更新值.
每次登录后,请检查数据库中的值并相应地重定向用户

2)您可以在客户端使用cookie并在首次登录后更改其值.每次登录后,检查天气cookie是否存在,并相应地在不同页面上重定向用户
you are using HTTP protocol which is state less and it could not store anything for the next call

here you can choose one of two way:
1) use database and update the value after user login first time.
Each time after login check the value from DB and redirect user accordingly

2)You can use cookie on client side and change it''s value after first login. after login each time check weather cookie is present or not and accordingly redirect user on different page