Solved

Create a hyperlink in a C# 2005 project to a html page contained in the project

Posted on 2008-06-12
1
472 Views
Last Modified: 2013-11-26
Hi there

I've written a Window application in Visual C# 2005 which displays a form. This form contains a WebBrowser control. I have also in the solution a html page called HTMLPage3.htm

I'd like to fill the web browser with an image having a hyperlink to HTMLPage3.htm

How can I do that ?

The line below doesn't work.

Thanks in advance
webBrowser1.DocumentText = "<a href=\"HTMLPage3.htm\"><img  src=\"http://.../image.gif\" /></a>";

Open in new window

0
Comment
Question by:B_B_Boris
1 Comment
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 21771609
>>I have also in the solution a html page called HTMLPage3.htm
Where is this file? you have to provide a full path to the file, if not, the browser will not know where to locate the file. Since, once installed, the file will be located in different folders, you will have to provide the correct path, something like:


webBrowser1.DocumentText = string.Format("<a href=\"file:\\\\{0}\\HTMLPage3.htm\"><img  src=\"http://.../image.gif\" /></a>", theFolder);

where theFolder variable is some folder where the file is located once installed, it can be obtained like:
string theFolder = Application.StartupPath;
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now