博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

后台找前台服务器控件,客户端控件方法

Posted on 2008-10-09 11:56  小飞龙(Jack)  阅读(395)  评论(0编辑  收藏  举报
protected void gvInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            Button btnDel = e.Row.FindControl("btnDel") as Button;   //找服务器控件
            HtmlInputButton btnCheck = e.Row.FindControl("btnCheck") as HtmlInputButton; //找客户端控件
            if (btnDel != null)
            {
                string UseFlag = e.Row.Cells[8].Text;
                if (UseFlag == "0" || UseFlag == "1")
                {
                    btnDel.Enabled = true; //使用标志为0(不可用)或1(未发出) -- 删除按扭可用
                }
                else
                {
                    btnDel.Enabled = false;
                }
            }
            if (btnCheck != null)
            {
                string UseFlag = e.Row.Cells[8].Text;
                if (UseFlag == "2")
                {
                    btnCheck.Disabled = false; //使用标志为2(已发送) -- 核销按扭可用
                }
                else
                {
                    btnCheck.Disabled = true;
                }
            }
        }