Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
Is this bug of DocumentText in webbrowser control ?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
knonk knonk
14y
4.8k
1
Reply
Hi, Im using webbrowser control in C# to display content, and I used pasteHTML to change the content of webbrowser control when user clicked on a button, code looks like this :
CODE
public
void
OnClickButton1
(
object
sender
,
EventArgs
e
)
{
IHTMLDocument2
htmlDocument
=
browser1
.
Document
.
DomDocument
as
IHTMLDocument2
;
IHTMLSelectionObject
currentSelection
=
htmlDocument
.
selection
;
if
(
currentSelection
!=
null
)
{
IHTMLTxtRange
range
=
currentSelection
.
createRange
()
as
IHTMLTxtRange
;
range
.
pasteHTML
(
"<b> Text is inserted by pasteHTML method</b>"
);
range
.
collapse
(
true
);
range
.
select
();
}
}
But when I get text from browser1 control by this code :
CODE
string
documentText
=
browser1
.
DocumentText
;
It dosen't exist string "<b> Text is inserted by pasteHTML method</b>" in documentText variable !
Anyone can explain why for me, please ? and How can I get that document text which is inserted dynamic by pasteHTML(..) method at runtime ?! thanks alot.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
print listbox in c#
About font