在复选框列表中禁用选中的复选框 [英] disable selected checkbox in checkboxlist
问题描述
您好,我正在为员工维护一个出勤项目.
我已经在下拉列表中分配了几个月.
并使用复选框列表分配日期.
我想在员工单击标记出勤后禁用日期.
hi i am doing a project on attendance maintained for employee.
i have assigned months in dropdownlist.
and assigned dates using checkboxlist.
i want to disable the date once the employee clicks on mark attendance.
it also has to saved in the database.
推荐答案
回答您的评论.
answer for your Comment.
感谢..............我还有一个疑问...
我想将数据库中的值绑定到标签中...
说我有一个表emp,其中的列名称为Hra,Pf,DA.
我想在标签1中显示名称,在标签2中显示hra,在标签中显示pf等等.....
你能帮我吗?
thanks.............. i have one more doubt...
i want bind values from database into label...
say i have a table emp which has columns name,Hra,Pf,DA.
i want to display name in label1, hra in label 2 ,pf in label so on........
can u help me?
试试这个
Try This
//where ds is your dataset
int j = ds.Tables[0].Columns.Count;
for (int i = 1; i <= j; i++)
{
// if you use masterpage use this
Label lblcolumns = (Labels)this.FindControl("ctl00
ContentPlaceHolder1
ContentPlaceHolder1
lblcolumns" + i.ToString()); // 如果您不使用母版,请使用此 标签lblcolumns =(标签)此 .FindControl(" + i.ToString()); // 在下一行中 lblcolumns.Text = ds.Tables [" ].rows [ 0 ] [i] .ToString(); }
lblcolumns" + i.ToString()); //if you don't use masterpage use this Label lblcolumns = (Labels)this.FindControl("lblcolumns" + i.ToString()); // in next line lblcolumns.Text = ds.Tables["your table name or id"].rows[0][i].ToString(); }
可能会对您有帮助
May this will help you
这篇关于在复选框列表中禁用选中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!