如何禁用ASP.net中的导航链接 [英] how to disable navigation link in ASP .net

查看:63
本文介绍了如何禁用ASP.net中的导航链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在用户未通过身份验证时禁用导航链接.

disable the navigation link when user is not authenticated

推荐答案

在Page_Load中,查看用户是否通过了身份验证.如果不是,请隐藏,禁用您不想授予访问权限的控件.简单的!尝试!
In Page_Load, see if the user is authenticated or not. If not, just hide, disable the controls you don''t want to give access. Simple! Try!!


如果要在用户未通过身份验证时隐藏链接,则可以将其与控件的可见性绑定.否则,如果要禁用控件,可以将其与isEnabled绑定.
If you want to hide the links when user is not authenticated then you can bind it with control''s visibility. Else you can bind it with isEnabled if you want to disable the control.


这篇关于如何禁用ASP.net中的导航链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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