Hi,
I am making an autofill-program, and have some issues with selecting radiobuttons. I use Visual C# 2010 express edition.
Normally I just use getelementsbyid, setattribute and invokemember, but I don't see how I can select a radiobutton without id. Maybe I need to edit the html to make a radiobutton checked, and then just use invokemember to submit?
type="radio" name="x1" value="ve"> Vero
type="radio" name="x1" value="ee"> Eee
type="radio" name="x1" value="wa"> Walla
type="radio" name="x1" value="qu"> Quack
As you see, there is no default select.
I'am new to C# so I don't know what it can do, but it would be cool to learn how to edit websites html through C#. I really just need to add "checked" to one of them radiobutton. I have a lot of experience with html, so if I can find out how I can use C# to find and insert code; it would be great.
Best Regards
Kenneth4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
KennethPosted Apr 27, 2011, 4:24 PM
Amit ChoudharyPosted Apr 27, 2011, 1:46 PM
Check out the HTML Agility Pack to do all sorts of HTML manipulation
It gives you an interface somewhat similar to the
XmlDocumentXML handling interface:KennethPosted Apr 27, 2011, 1:34 PM
Amit ChoudharyPosted Apr 27, 2011, 1:09 PM
The html files can be treated as XML files so you can use XML classes to manipulate the HTML attributes. so as per your requirement you can insert the checked attribute into the radio button.