asp.net中的登录页面错误 [英] Login Page error in asp.net

查看:76
本文介绍了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


这篇关于asp.net中的登录页面错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆