从web.config文件控制链接按钮的可见性 [英] Control the visibility of link button from web.config file

查看:52
本文介绍了从web.config文件控制链接按钮的可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建一个网页。我想限制链接按钮对特定用户的可见性。没有登录页面,必须从Windows登录中捕获用户信息。必须在web.config文件中管理所有能够查看链接的用户。我怎么能这样做。



谢谢你

Hi,
I am creating a web page. I want to restrict the visibility of the link button to the particular users. There is no login page, and user information has to be capture from windows login. The users who all able to view the link has to be managed in the web.config file. How can I do it.

THANK yOU

推荐答案

1)在网络中的AppSettings中添加一个键.config文件为
1) Add one key in AppSettings in web.config file as
<add key="IsVisible" value="1" />



2)在page.cs中,该按钮位于检查键值为


2) In page.cs where that button resides check key value as

bool IsVisible = ConfigurationManager.AppSettings["IsVisible"].ToString() ;
if(IsVisible = "1") 
{
   yourbutton.Visible = true;
}
else
{
   yourbutton.Visible = false;
}





希望这会有所帮助!!



Hope this helps!!


这篇关于从web.config文件控制链接按钮的可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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