473,326 Members | 2,126 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,326 software developers and data experts.

AxSHDocVw.AxWebBrowser Component Question

Hi all,

Quick question about the AxSHDocVw.AxWebBrowser Component. I was wondering
if there is a way to view pages generated internally within my application
without writing them to disk. For instance, I'd like to do something like
the following:

string page = "<HTML><BODY>This is a test.</BODY></HTML>";

And display the page variable's contents in the AxWebBrowser (without
writing to disk and using the .Navigate() method to re-load the file.) Any
help is appreciated.

Thanks,
Michael C., MCDBA
Nov 16 '05 #1
3 2948
Hello Michael,
string page = "<HTML><BODY>This is a test.</BODY></HTML>";

And display the page variable's contents in the AxWebBrowser (without
writing to disk and using the .Navigate() method to re-load the file.) I had the same problem in the past.
My solution is to write the file in the system temp directory.

System.IO.Path.GetTempFileName()
returns a uniquely named zero-byte temporary file on disk and returns the full path to that file that you can write.
After write the html code, you can pass this path to the .navigate method.
Remember to delete this file when you close the application.
Any help is appreciated. I Hope thaht this help you.

Bye
--
____________________________
Mighell (http://www.datadream.it)

Hi all,

Quick question about the AxSHDocVw.AxWebBrowser Component. I was
wondering if there is a way to view pages generated internally within
my application without writing them to disk. For instance, I'd like
to do something like the following:

string page = "<HTML><BODY>This is a test.</BODY></HTML>";

And display the page variable's contents in the AxWebBrowser (without
writing to disk and using the .Navigate() method to re-load the file.)
Any help is appreciated.

Thanks,
Michael C., MCDBA


Nov 16 '05 #2
Thanks Mighell,

But that solution requires "writing to disk and using the .Navigate() method
to re-load the file." I've found another solution that works without
creating a file, some of the code is on the MS Website, the rest is borrowed
from Stefan Popov.

It works like this:

// dummy ref objects for Navigate call to about:blank
object Zero = 0;
object EmptyString = "";
// HTML to display
string aString = "<HTML><BODY>This is a test</BODY></HTML>";
// Have to navigate to about:blank first, or axWebBrowser1.Document will be
null
axWebBrowser1.Navigate("about:blank", ref Zero, ref EmptyString, ref
EmptyString, ref EmptyString);
// Create an IHTMLDocument2
IHTMLDocument2 doc = axWebBrowser1.Document as IHTMLDocument2;
// Write the HTML to the doc
doc.writeln(aString);
// Close the doc
doc.close();

Thanks anyway,
Michael C., MCDBA

"Mighell" <mighell_TOGLI@mart3_TOGLI.it> wrote in message
news:X_*********************@twister1.libero.it...
Hello Michael,
string page = "<HTML><BODY>This is a test.</BODY></HTML>";

And display the page variable's contents in the AxWebBrowser (without
writing to disk and using the .Navigate() method to re-load the file.) I had the same problem in the past.
My solution is to write the file in the system temp directory.

System.IO.Path.GetTempFileName()
returns a uniquely named zero-byte temporary file on disk and returns the

full path to that file that you can write. After write the html code, you can pass this path to the .navigate method.
Remember to delete this file when you close the application.
Any help is appreciated.

I Hope thaht this help you.

Bye
--
____________________________
Mighell (http://www.datadream.it)

Hi all,

Quick question about the AxSHDocVw.AxWebBrowser Component. I was
wondering if there is a way to view pages generated internally within
my application without writing them to disk. For instance, I'd like
to do something like the following:

string page = "<HTML><BODY>This is a test.</BODY></HTML>";

And display the page variable's contents in the AxWebBrowser (without
writing to disk and using the .Navigate() method to re-load the file.)
Any help is appreciated.

Thanks,
Michael C., MCDBA

Nov 16 '05 #3
My issue is related to this. I have no problem getting the following
code to work when it is embeded in a class that contains the Main
method (i.e. a form that starts up when you run the application).
However, the way my application runs, there are many screens prior to
the web brower form showing. For some reason, if I don't call the web
browser form as the startup object - nothing ever populates in the
browser. It will if it is the startup and won't if it's not. Other
info - the form is a mdi child...

This is getting extremely frustrating. Any help is much appreciated!!!

Nov 16 '05 #4

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

Similar topics

0
by: David Elliott | last post by:
I have created an application that loads assemblies (plugins). These plugins are windows forms that have an embedded browser. private AxSHDocVw.AxWebBrowser browser; If I comment out...
3
by: Simon CJC | last post by:
Hello I use AxSHDocVw.AxWebBrowser in a windows application. But sometimes the url I browsed in AxSHDocVw.AxWebBrowser contains error caused by javascript. Can I prevent javascript from running in...
1
by: Pengyu | last post by:
I host AxSHDocVw.AxWebBrowser in my C# application. It generally works ok. However, the AxSHDocVw.AxWebBrowser control sometime stucks and can not nevigate to other URLs. What is the problem? BTW,...
0
by: Eþref DURNA | last post by:
I m navigateing a url and want to display that image at my web browser on my Windows application I m using AxSHDocVw.AxWebBrowser but when ever i redirect that url it does not shows that image it...
0
by: Adrian Belen via .NET 247 | last post by:
hi, I have a problem when I try to open an excel document in a AxWebBrowser Component in VB.NET. The problem appear in this situation: Before to all the Excel application is opened from the...
3
by: MPR | last post by:
Hi guys; I'm using an AxSHDocVw.AxWebBrowser control to show a web page. I need to know if i can ( and how? ) i do the following things: 1 - I need to follow 1 link in the webpage diplayed...
1
by: jokolee | last post by:
i was using component AxSHDocVw.AxWebBrowser,,but i rather confuces because when i write AxWebBrowser1.Document. the next option is Gettype function,,,nothing else...... But when i write...
0
by: sagar.jawale | last post by:
Hi, In my c# windows application, i am using AxSHDocVw.AxWebBrowser. I am displaying a generated receipt html in this browser. Also, for printing the same html, i am using the following command...
0
by: Fette | last post by:
I am using the AxSHDocVw.AxWebBrowser navigate2() method to launch the login web service for my application. IIS has been configured to require client side certificates. I am using a smart card...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.