473,804 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AxSHDocVw.AxWeb Browser Component Question

Hi all,

Quick question about the AxSHDocVw.AxWeb Browser 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>Th is 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 2977
Hello Michael,
string page = "<HTML><BODY>Th is 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.AxWeb Browser 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>Th is 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>Th is is a test</BODY></HTML>";
// Have to navigate to about:blank first, or axWebBrowser1.D ocument will be
null
axWebBrowser1.N avigate("about: blank", ref Zero, ref EmptyString, ref
EmptyString, ref EmptyString);
// Create an IHTMLDocument2
IHTMLDocument2 doc = axWebBrowser1.D ocument as IHTMLDocument2;
// Write the HTML to the doc
doc.writeln(aSt ring);
// Close the doc
doc.close();

Thanks anyway,
Michael C., MCDBA

"Mighell" <mighell_TOGLI@ mart3_TOGLI.it> wrote in message
news:X_******** *************@t wister1.libero. it...
Hello Michael,
string page = "<HTML><BODY>Th is 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.AxWeb Browser 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>Th is 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
1986
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 this.browser = new AxSHDocVw.AxWebBrowser(); and associated code to avoid exceptions like this.browser.Dock = System.Windows.Forms.DockStyle.Fill; this.browser.Enabled = true;
3
3382
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 AxSHDocVw.AxWebBrowser Thanks Simon CJC
1
2432
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, the network connection is ok. Thanks a lot, Pengyu
0
1386
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 starts to download it I dont want to Download that Image i want to display it on my AxSHDocVw.AxWebBrowser or could someone tell me how do i control the windows file download dll ?
0
1769
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 user with some document xls. After that my application open an excel document (can be another document) using the component AxWebBrowser Then the first applications have problem when I try to modify the document.
3
3875
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 in the AxSHDocVw.AxWebBrowser control. 2 - I need to input some data in a texto box on it
1
2005
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 AxWebBrowser1.Document.all.tags("DIV").length() the code is running well....WHY..?? i realy confuces because AxWebBrowser1.Document.all it's not in the library but it's not error.....why..??? *-----------------------*
0
2059
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 : axWebBrowser2.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,ref empty,ref empty);
0
1990
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 and choose the appropriate certificate from those that are found on the card. My question is this: Is navigate2() a blocking method? That is, when I make the call to navigate2 with my login service URL and Internet Explorer pops up the PIN...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.