角色认证?

编程入门 行业动态 更新时间:2024-10-24 02:00:29
本文介绍了角色认证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了一个电子商务网站。 有两种类型的用户名 1:-Admin Page 2: - 用户登录页面 现在我有一个问题 当我使用用户帐户登录并提供管理页面链接 用户可以轻松访问管理页面 当用户编写管理页面链接然后页面进入其主页时,我该如何解决这个问题 我尝试过: 基于角色的用户身份验证或amdin

am create a e-commerce website. there are two type of user roll 1:-Admin Page 2:-User Login Pages now I have a problem when I login with user account and give admin pages link user can access easily admin pages how can I fixed this problem when user write admin page link then page going on its home page What I have tried: role based authentication for user or amdin

推荐答案

尝试在文件夹中创建网站Admins,只允许在web.config中访问角色admin。 Try create a sites in folder of "Admins", allows only roles admin access in web.config. <location path="Admins"> <system.web> <authorization> <allow roles="Admin" /> <deny users="*" /> </authorization> </system.web> </location>

它会跳回主页,因为不允许授权。 有你曾经使用过 It jump back to home page because the authorization is not allowed. Have you ever using Microsoft.AspNet.Providers okay , you know how to use ASP.NET Web Sites Administration Tool, right? set a "Admins" roles right there, and assign that user to Admins roles.

? then跟着我在最顶层发布的信息一样。 然后在登录视图中,在编辑项目中创建一个值Admins并在角色组中切换, 最后添加超链接以带你到那些页面。

? then followed the same as i show you on top post. then in login view, create a value "Admins" in "Edit Item" and switch it in rolegroup, last add hyperlink to bring you to that pages.

<asp:LoginView ID="LoginView1" runat="server"> <RoleGroups> <asp:RoleGroup Roles="Admins"> <ContentTemplate> <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# "~/Admins/ManageAdmin.aspx?id=123" %>' runat="server" Target="_blank" /> </ContentTemplate> </asp:RoleGroup> </RoleGroups> </asp:LoginView>

更多推荐

角色认证?

本文发布于:2023-10-24 16:57:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524498.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:角色

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!