473,789 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebBrowser control as an HTML document viewer?

I'm writing an application that will manage a database of documents typed
into the application by the user. Some documents will contain links to other
documents. If the user clicks on a link, the application will get the linked
document from the database and display it. The .NET 2.0 WebBrowser control
looks like a good candidate to display the documents (document entry will by
done by a form with text boxes).

Here are my questions:

(1) Is the WebBrowser a good candidate for this role? Are there better
Windows Form controls readily available?

(2) Are there any good examples out there of how to code the links? From
MSDN, the best approach seems to be to store the record ID of the linked
document in the URI property, then trap the Navigating event and get the ID
from the event args. Are there better approaches?

Thanks in advance.

David Veeneman
Foresight Systems
Jan 19 '07 #1
1 5814
David,

I think that the WebBrowser control is a fine candidate.

The solution you offer is a good suggestion. As long as you are
consistent in how you shape your urls which you will ultimately intercept,
you should be fine.

However, I would recommend creating your own scheme (you can do this by
having an asynchronous pluggable protocol handler) and then handling the
processing in there. It is cleaner, and you won't have to write a whole lot
of junk code in order to get the links to work properly. As long as you
generate the HTML correctly and the links correctly, your pluggable protocol
handler will do the heavy lifting of getting (and possibly generating) the
content.

Of course, it will require a great amount of interop of you do this in
..NET, but I think it is the cleaner solution.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"David Veeneman" <da****@nospam. comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
I'm writing an application that will manage a database of documents typed
into the application by the user. Some documents will contain links to
other documents. If the user clicks on a link, the application will get
the linked document from the database and display it. The .NET 2.0
WebBrowser control looks like a good candidate to display the documents
(document entry will by done by a form with text boxes).

Here are my questions:

(1) Is the WebBrowser a good candidate for this role? Are there better
Windows Form controls readily available?

(2) Are there any good examples out there of how to code the links? From
MSDN, the best approach seems to be to store the record ID of the linked
document in the URI property, then trap the Navigating event and get the
ID from the event args. Are there better approaches?

Thanks in advance.

David Veeneman
Foresight Systems

Mar 29 '07 #2

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

Similar topics

0
3476
by: Trevor Fairchild | last post by:
I'm trying to have VB6 write an html file during run-time, with some VBScript functionality. The intent is to display images based on the current record within the program - using a WebBrowser - plus some buttons to dynamically resize the image. I have gotten almost everything to work - I put in a function to simply disable the right-click option of the browser, but none of the other functions work. If I copy the source data out of...
5
2772
by: Charles Law | last post by:
Sorry for the cross post, but I'm not sure who is best placed to answer this one. This is the most bizarre behaviour of MSHTML and streams. I have a WebBrowser control that contains nothing but some default HTML. I want to copy the document and modify it before saving it to disk. So, I clone the document like this:
1
2660
by: boxim | last post by:
Hi All, Just after some other opinions really.... We're writing this application that in places implements the WebBrowser control to make certain bits look nicer as well as make things quicker to develop. To write each page as an owner drawn control would take ages. The only thing that bothers me is the comminication between the browser control and the main application. We're using the mshtml.dll to hook events
4
12637
by: Toma Marinov | last post by:
Hello ! I made some test with webbrowser control in VS.2005. When I load a word document in webbrowser through .Navigate method (from my hdd), I want to get the stream of the loaded doc file with .DocumentStream, but this property is null. The property .DocumentText is = "" too. Am I missing something ? Thank you very much !
2
2010
by: Spencer | last post by:
I am using the WebBrowser control in .NET 2.0 but it is throwing an error when trying to run a html page that has some JScript and an applet within it. The page runs fine via a standard IE 6.0 browser. But as soon as I try to navigate to the page I get an "Object doesn't support this property or method" error and the java applet is not displayed. I can run the application on a different PC so it appears to be a setting on the PC that...
12
6380
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
8
3421
by: Prosperz | last post by:
Hi, I would like to make thumbnails of web page by capture content of a WebBrowser. By example, capture http://www.google.com. I used WebBrowser control with Framework 2.0. I try this : *************************************************
4
12011
by: Steve Richter | last post by:
I would like to build an HTML stream as a string and have the WebBrowser control render that HTML. Then on PostBack, or whatever it is called, I would like my code to be the one that receives what the WebBrowser control is sending. Effectively, my code would be the web server and the WebBrowser control would be the web client. All the examples I am seeing have the WebBrowser control being directed to a URL from which to get the HTML...
0
2027
by: =?Utf-8?B?c25naWxi?= | last post by:
I am having 3 issues with the WebBrowser control which may all be related. The HTML for the page is the standard Weather Magnet from weather.com. The actual HTML is at the bottom of this page. Issue 1: I am opening a page in the control in the development environment and the document comes up correctly. But, when I click a link in the resulting document, an external IE instance comes up with the requested page. I have see reference to...
0
9666
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...
1
10139
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
9983
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
6769
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();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
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
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.