Getting HTML Source code for selected area

In C# programming, I have displayed a webpage in WebBrower Component and can get the source code for that page. However, I wonder how can I get the source code for a SELECTED AREA in that webpage. Like the way you see in DREAMWEAVER (once you selected some controls in DESIGN window, you will see the corresponding HTML code in CODE window).

Many thank for quick answers and tips of how to do that task.
bBKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fcnatraSoftware...Commented:
There are an attribute that allows to "move" and "edit" the content of a region in an executing web page. I don't remember the attribute name, but the name contains the word "content". Is like "editablecontent" or something like that.

Anyway, check this link below. It gives you more hints.

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/dhtml.asp


good luck
0
bBKAuthor Commented:
I'll check it now.

Thanks
0
bBKAuthor Commented:
Sorry, but it's not what I want. The link u gave just only about DHTML with dynamic content. :(

thanks,
Ngoc
0
fcnatraSoftware...Commented:
bBk, (by the way, do you speak spnsh?)

the link helps you just to get the content of a control.
A selected area inside a control can be captured with the Range method.
For example, a selected area into a textarea (with javascript):

var selectedText = textEdit.document.selection.createRange().text;
var boldedText = "<b>" + selectedText + "</b>";
textEdit.document.selection.createRange().pasteHTML(boldedText);

CN
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fcnatraSoftware...Commented:
I guess my answer helped bBk to solve his doubt, otherwise, he would have aswered back again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.