473,382 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

MS Web Browser from HTML string

Hi -

Could someone tell me if it is possible to set the display of the MS Web
Browser control to an HTML string?

So for instance (SetText method doesn't exist, but you get the idea):

axWebBrowser.SetText ("<html><body><b>Text to display!</b></body</html>");

I can obviously use the Navigate if it was in a file, but I just have a
string in memory. I could save it to disk, but would prefer to work solely
in memory if possible.

TIA

- Andy
Nov 15 '05 #1
1 2362
HI Andy,

The closest thing that I can think of is to Navigate to the
"about:blank" and then set the axBrowser.Document.body.innerHTML
property to the HTML text that you want to display in the browser.

axBrowser.Document.body.innerHTML = "<b>Text to display!</b>";

Before you set the property, ensure that the navigation to "about:blank"
has completed and Document.body contains valid content..
Then there's also a way to get the text to load via the
IPersistStreamInit.Load method since the Document object
supports the IPersistStreamInit interface, but its a bit more circuitous
than
the first approach mentioned above.

Regards,
Aravind C
"Andy Bates" <An********@UltimateSoftwareSolutions.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
Hi -

Could someone tell me if it is possible to set the display of the MS Web
Browser control to an HTML string?

So for instance (SetText method doesn't exist, but you get the idea):

axWebBrowser.SetText ("<html><body><b>Text to display!</b></body</html>");

I can obviously use the Navigate if it was in a file, but I just have a
string in memory. I could save it to disk, but would prefer to work solely
in memory if possible.

TIA

- Andy

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andre | last post by:
Hello, I am working on refactoring my companies search engine, and a critical component of the search is that the results be displayed very quickly. We have done enourmous work on making the...
0
by: AlanF | last post by:
Here is my perplexing issue and I've looked EVERYWHERE for help (well almost everywhere.... probably should have started here :)) I am using a Webclient to successfully retrieve a "downloadata"...
4
by: lkrubner | last post by:
I'd like to write a PHP script to be used from the command line on a Unix machine. I'd like for the script to put together a string, turn it into a web page, print it, then return control the...
8
by: Robert | last post by:
I am creating a small help browser. It is pretty much finished except I cannot find how to pass a file to it (i.e. browser.exe index.html, or any html file, and the html file opens in the browser)...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
22
by: petermichaux | last post by:
Hi, I would like to display a message to Internet Explorer clients to encorage them to get Firefox. Yes they may like Internet Explorer but it is my site :) http://www.explorerdestroyer.com/...
9
by: rajasekhar | last post by:
Hallo, I am developing a site, and here whats the problem is: how to partition the code, i.e. if I developed 1000 lines of code, in that I want to show first 200 lines only if the user opens my...
0
by: etnaelk | last post by:
Hi all, I have a real bugger of a problem that I just haven't been able to figure out. I am working on writing my own proxy server in C# using TcpListener, TcpClient, HttpWebRequest/Response and...
2
by: zoeabraham | last post by:
I am Using STRUTS1.4 in NetBeans5.5 IDE Here we have a JSP Page <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"...
7
by: Anil | last post by:
I have a Javascript program which runs in the browser and has functions work(), and stop(). It listens to commands from the server to work() and can be interrupted by the server to stop(). I am...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.