如何在asp.net中使用多个登录 [英] How to use multiple login in asp.net
本文介绍了如何在asp.net中使用多个登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为职员登录的表格,职员可以使用用户名和密码登录并从下拉列表中检查其登录类型,即admin还是一般职员,根据以下哪个逻辑可以在两个不同的aspx页面上同时发送此人他们的类型.
假设他选择admin,然后选择admin.aspx,如果再选择staff,则选择staff.aspx
I had a form called staff login where a staff can login with username and password and check its login type i.e. admin or general staff from a dropdown list what should be a logic for sending both the person on two different aspx pages according to their type.
suppose if he selected admin then admin.aspx and if staff then staff.aspx
推荐答案
最简单的方法是这样的:如果您匹配的用户名和密码来自数据库,然后您可以添加一个名为usertype
的列,并在登录时也检查此列的值,如果usertype
是admin,则重定向到admin.aspx,然后重定向到其他页面.
您还可以使用 ^ ]来实现.
希望对您有所帮助:)
Simplest way is to do like this:if you are matching the username and password from database then you can add a column calledusertype
and check this column value also at the time of login , if theusertype
is admin then redirect to admin.aspx else to other page.
you can also use ASP.net Roles and membership[^] to implement this.
hope it helps :)
这篇关于如何在asp.net中使用多个登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文