
Untitled
By: a guest on
Jul 20th, 2012 | syntax:
None | size: 0.46 KB | hits: 8 | expires: Never
Find textBox, checkBox, any object by name C#
void checking(int input)
{
CheckBox checkbox = (CheckBox)this.Controls["checkBox" + input.toString()];
if(checkbox.isChecked)
//do something here
}
void checking(int input)
{
CheckBox checkbox = (CheckBox)this.FindControl("checkBox" + input.toString());
if(checkbox.isChecked)
//do something here
}
CheckBox checkbox = (CheckBox)this.Controls.Find("checkBox" + input.toString())[0];