hi
i have an web page that has 200 checkbox in it
and i must check all checkbox in this page and else similar page
how can i write a program that can do it automatically?
i think i can get place of checkboxs in pixel and i put cursor of mouse on that and automatically click there
but it not seems be true way
is there any way?
or better way?
thanks
Loading
Sam HobbsPosted Sep 30, 2010, 6:28 PM
Bahar JalaliPosted Sep 30, 2010, 5:39 AM
sorry i forget say that the page is not mine
and i don't have any control on that
for example one page on the internet that have 200 checkbox
can i get ids of every check box and set they to checked?
please help
thanks
Manikavelu VelayuthamPosted Sep 30, 2010, 2:18 AM
Below code will help you to acheive your goal
private void CheckCheckBox(Control Page)
{
foreach (Control ctrl in Page.Controls)
{
if (ctrl is CheckBox)
{
((CheckBox)(ctrl)).Checked = true;
}
else
{
if (ctrl.Controls.Count > 0)
{
CheckCheckBox(ctrl);
}
}
}
}
//Call this function in page_load
SetTextBoxBackColor(this);