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
Check all checkbox in a webpage automatically!
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 29, 2010, 10:18 PM EDT
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);
Bahar Jalali165 reputationPosted Sep 30, 2010, 1:39 AM EDT
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
Sam HobbsRank #108 · 20.5K reputationPosted Sep 30, 2010, 2:28 PM EDT