I’m trying to set the value of textarea programatically using C#.Net webbrowser control and I have tried many solutions. some of them worked fine but not for all web sites.
Here is my code
HtmlElement item ;
.....
if (item.GetAttribute("name") == TextBody)
{
try
{ //code reaches this point
//for some pages, all the coming solutions do not work
item.SetAttribute("value", MyText);
item.InnerText = MyText;
item.InnerHtml = MyText;
}
I ended up with a conclusion that those web sites may be don’t allow setting values by code. this restriction can be set, right?
If so, does any one have another solution ?
I think about sending POST request manually containing all information. But I have no idea how this can be done and I don’t know what’s supposed to be written in the post request headers and data. If there is some tool or plugin that enable me to check the original post content to make similar one, it would be good.
Thanks in advance.
The solution is to use the same code above but disable the java script in browser.