Sunday 15 March 2015

c# - How radio button click if included onclick function? -



c# - How radio button click if included onclick function? -

<asp: label input name="id" value="p" onclick="form.submit(); homecoming false;" type="radio">personal / romance /label>

i trying below both code not getting solution. please if have solution it's help me.

webbrowser1.document.getelementbyid("id").setattribute("value", "p"); foreach (htmlelement el in webbrowser1.document.getelementsbytagname("label")) { if (el.innertext == ("personal romance")) { el.invokemember("click"); } }

your code looks okay, innertext of label not personal romance

try this:

string searchstring = @"personal / romance"; if(el.innertext.equals(searchstring) { el.invokemember("click"); }

check when expect element if right tag name label. can tell sure not asp:label. can check inspect elements in chrome, if tag name different utilize right 1 when taking webbrowser1.document.getelementsbytagname(correct tag)

c# asp.net radio-button webbrowser-control

No comments:

Post a Comment