-
September 16th, 2010, 04:42 AM
#1
Copying content to a DOM Textarea element in c#
Greeting,
I sometimes have a problem with the code below. Sometimes it returns a strange error depending on the content I want to pass to the Textarea element of a webpage.
Code:
HtmlDocument DOC = this.webBrowser1.Document;
foreach (ListViewItem lvi in lvFieldsCopying.Items)
{
if (lvi.SubItems[2].Text != "")
{
HtmlElementCollection oHtmlElements = DOC.GetElementsByTagName("textarea");
foreach (HtmlElement textarea in oHtmlElements)
{
if (textarea.Name == lvi.SubItems[2].Text)
{
//MessageBox.Show(lvi.SubItems[1].Text);
try {
textarea.InnerHtml = lvi.SubItems[1].Text.ToString();
}
catch (Exception exp) {
MessageBox.Show("Could not copy your field to the site field: " + exp.Message);
}
}
}
}
}
Sometimes, depending on the content of the SubItem, exp.Message is "Exception from HRESULT: 0x800A0259".
Did someone run into this already?
-
March 29th, 2013, 03:23 AM
#2
Re: Copying content to a DOM Textarea element in c#
Hi, did you solve this problem?
I also have the same problem in my program, a little strange.
Can you give some suggestion? Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|