在注册页面上需要有关userid和pwd的帮助 [英] want help regarding userid and pwd in an registration page

查看:99
本文介绍了在注册页面上需要有关userid和pwd的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有asp.net的Web应用程序,具有登录名feild.现在将有2位用户,其中一位管理员和另一位普通用户.现在我应该为用户和admin创建2个不同的表,但是这种情况会使我在网页上同时为用户和admin拥有2个登录字段,但是我只需要1个登录名,但是如果我有一个登录名,那么我必须将这两个详细信息都保留在我认为不可能的单个表中.或者我必须创建一些特殊的存储过程.请提供有关如何执行具有单个登录字段的登录过程的建议.成功登录后,应将其定向到适当的页面,管理员具有不同的页面和用户页面.

请提出

谢谢你
anoop

hi i have a web asp.net web application having login feild . now there are going to be 2 users one admin and other normal user. now should i make 2 different tables for both user and admin.but this situations would led me to have 2 login field for both user as well as admin on web page but i want only 1 login but if i have one login then i have to keep both details in single table which i donot think is possible.or i have to create some special stored procedures.please advice how to carry out login process having single login field. after logging sucessfully one should be directed to appropriate pages admin have different pages and user pages .

please suggest

thank u
anoop

推荐答案

不,管理员是用户-只是具有额外权限的用户.
通常,您将拥有一个用户表,该表带有一个类型"列(或类,角色或权限,随便您怎么称呼),当您注册某人时,他们总是注册为标准用户.管理员功能之一是将用户提升"为管理员.

这样,您也只需一次登录.

如果您使用内置的ASP.NET MembershipProvider系统,则还可以使用RolesProvider系统,该系统将为您处理所有这些.使用此功能还可以更轻松地保护"您的页面,因为您可以将其保存在需要已登录用户访问的文件夹中,如果未登录的用户尝试访问它们,则可以重定向到登录页面
No, an Admin is a User - just a user with extra permissions.
Normally, you would have a User table, with a Type column, (or class, or role, or permissions, call it what you will) and when you register someone, they always register as a standard user. One of the Admin functions is to "promote" users to admin.

That way, you have just the single login as well.

If you are using the built in ASP.NET MembershipProvider system, you can also use the RolesProvider system, which will handle all that for you. Using this also makes it easier to "protect" your pages, as you can keep them in a folder which requires a logged in user to access, and re-directs to the log in page if a non-logged in user tries to access them.




仅使用一张表格和一张登录表格.登录时,检查用户角色并基于角色重定向到他们的页面.有2个角色:1.用户2.管理员

单击登录按钮时,检查角色,如果是ADMIN,则重定向到管理面板,如果是用户,则重定向到用户面板.
Hi,

Use only one table and one login form. At time of login, Check Role of User and based on Role redirect to their page. There is 2 Roles :1. User 2. Admin

At click of Login Button, Check Role, if ADMIN then redirect to admin Panel and If User then Redirect to User Panel.


这篇关于在注册页面上需要有关userid和pwd的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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