可见属性不起作用 [英] visible property is not working

查看:69
本文介绍了可见属性不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
          ImageButton edit = (ImageButton)PreviousPage.FindControl("lnkEdit");
          ImageButton delete = (ImageButton)PreviousPage.FindControl("lnkDelete");
        CheckBox chkTest = (CheckBox)sender;
        GridViewRow grdRow = (GridViewRow)chkTest.NamingContainer;
        if (chkTest.Checked)
        {
            edit.Visible = true;
            delete.Visible = true;
        }
        else
        {
            edit.Visible = false;
            delete.Visible = false;
        }

    }



嗨这是我的代码,当我没有检查chekboxes时,我的图像按钮也可见


hi this is my code when i am not checking the chekboxes the also my image buttons are visible

推荐答案

如果这是检查中发生的所有处理都发生了变化,您可以在客户端进行。通过将display设置为none。
If this is all the processing that happens on the check changed, you could do it on the client side. By setting display to none.


Hi
首先,您可以在设计时或页面加载事件中将linkedit和linkdelete属性更改为flase u可以从两个链接按钮中设置属性为假。



问候

Aravind
Hi first u can change linkedit and linkdelete property visible to flase in design time or in page load event u can set property from both link button visible as false.

Regards
Aravind


这篇关于可见属性不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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