在另一页中使用button_click事件禁用按钮. [英] Disable the button using button_click event in another page ....

查看:72
本文介绍了在另一页中使用button_click事件禁用按钮.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的应用程序中,我有3个客户端页面和1个管理页面...每个客户端页面都有1个insert(database)按钮.管理员有2个按钮,例如禁用"和启用".如果管理员单击禁用"按钮,则所有客户端页面按钮都将被禁用,而管理员单击启用"按钮,则所有客户端页面按钮都将可见....你们能帮忙吗...

谢谢

Hi guys,

In my application I have 3 client pages and 1 admin page ...each client page have 1 insert(database) button. Admin have 2 buttons like disable and enable. If the admin click on disable button all the client page buttons will be disable and admin click the enable button all the client page buttons will be visible ....can u guys please help to do it ...

THANKS

推荐答案

使用为此目的归档的数据库
use a data base filed for do that


您可以将此类信息存储在Session中,但是我建议存储数据库中的此类信息.

例如

Well you could store such information in Session, but I suggest storing such information in database.

for instance

protected void buttonDisable_Click(object sender, EventArgs e)
{
    Session["DisableControls"] = true;
}

protected void buttonDisable_Click(object sender, EventArgs e)
{
    Session["DisableControls"] = false;
}



和其他页面



and in other pages

protected void Page_Load(object sender, EventArgs e)
{
    if(!this.IsPostBack)
    {
        buttonXYZ.Enabled = Session["DisableControls"] != null ? (bool)Session["DisableControls"] : true;
    }
}



我再说一遍,建议您考虑将此类信息存储在DB中.
还请阅读有关软件中角色概念的知识.



I''ll repeat myself, I suggest you consider storing such information in DB.
Also read something about Role concept in software.


这篇关于在另一页中使用button_click事件禁用按钮.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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