Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-12
1
Medium Priority
?
483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 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