Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Getting HTML Source code for selected area

Posted on 2006-04-25
8
Medium Priority
?
315 Views
Last Modified: 2010-08-05
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.
0
Comment
Question by:bBK
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:fcnatra
ID: 16542702
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
 

Author Comment

by:bBK
ID: 16553448
I'll check it now.

Thanks
0
 

Author Comment

by:bBK
ID: 16567128
Sorry, but it's not what I want. The link u gave just only about DHTML with dynamic content. :(

thanks,
Ngoc
0
 
LVL 4

Accepted Solution

by:
fcnatra earned 1000 total points
ID: 16583534
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
 
LVL 4

Expert Comment

by:fcnatra
ID: 16784031
I guess my answer helped bBk to solve his doubt, otherwise, he would have aswered back again.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question