I want to add a html control in C# which will display all the text from an html page selectively with the title given in my html page
-
What you want to do is not sufficiently explained. Give more detail and be as specific as possible please. You can't add HTML controls IN C#, you mean you want to use C# TO add HTML an control to a page, presumably? Where on the page? What is 'all the text'? What is 'selectively with the title'? Or do you want to create a custom control? And so on...Grant Thomas– Grant Thomas2011-01-07 13:37:20 +00:00Commented Jan 7, 2011 at 13:37
-
I wan to add the html control in such a way that it should display the text from the html page also it should provide the user with the html control on that page in such a way that user can editand update it.. the old way of writing the code will become very wrong hence wanted to use the html control for the web pageJinal– Jinal2011-01-07 13:41:18 +00:00Commented Jan 7, 2011 at 13:41
-
i m using C# for the project in asp.net this page is a part of my projectJinal– Jinal2011-01-07 13:42:18 +00:00Commented Jan 7, 2011 at 13:42
-
Your lack of real detail is still an abundance.Grant Thomas– Grant Thomas2011-01-07 13:42:40 +00:00Commented Jan 7, 2011 at 13:42
-
When you say "an HTML Control", do you mean a control which will display the contents of another web site?John Saunders– John Saunders2011-01-07 13:49:43 +00:00Commented Jan 7, 2011 at 13:49
2 Answers
Don't forget that when you are programming in ASP.NET, you are really programming in HTML. ASP.NET controls have their effect by generating HTML, which is then sent to the browser.
This changes your question. Your question is really, "how can I use HTML to display the contents of another web site, and how can I make ASP.NET generate the HTML that I need".
You can display the contents of another site by using an iframe:
<iframe id="myOtherSite" src="other site url"/>
You can simply place that on your ASP.NET page. However, it doesn't solve your problem with the title. I expect you can do that with some JavaScript, as your main window can access the DOM of the iframe to pick up the title and put it where you want it.