I've got a WebBrowser control in a C# Windows form. I build HTML on the fly
and then set it into the control using the DocumentText property of the
control. All of this works fine, except that part of the HTML that I
construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory
and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the
ability to link up to local files.
Thanks,
Chris 6 2572
First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link
works probably because it is being treated like a web-link with your
machine's server as the root. Again it's not correct. It shouldn't work. I
don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
I've got a WebBrowser control in a C# Windows form. I build HTML on the fly
and then set it into the control using the DocumentText property of the
control. All of this works fine, except that part of the HTML that I
construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory
and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the
ability to link up to local files.
Thanks,
Chris
First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link
works probably because it is being treated like a web-link with your
machine's server as the root. Again it's not correct. It shouldn't work. I
don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
I've got a WebBrowser control in a C# Windows form. I build HTML on the fly
and then set it into the control using the DocumentText property of the
control. All of this works fine, except that part of the HTML that I
construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory
and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the
ability to link up to local files.
Thanks,
Chris
Yes, I tried everything I could thing of to come up with different paths and
even prepending the "file://" onto the front didn't help.
Any other ideas?
Chris
"AHN" <an****@excite.com> wrote in message
news:Od**************@TK2MSFTNGP15.phx.gbl... First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link works probably because it is being treated like a web-link with your machine's server as the root. Again it's not correct. It shouldn't work. I don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message news:Om**************@TK2MSFTNGP10.phx.gbl... I've got a WebBrowser control in a C# Windows form. I build HTML on the fly and then set it into the control using the DocumentText property of the control. All of this works fine, except that part of the HTML that I construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the ability to link up to local files.
Thanks, Chris
Yes, I tried everything I could thing of to come up with different paths and
even prepending the "file://" onto the front didn't help.
Any other ideas?
Chris
"AHN" <an****@excite.com> wrote in message
news:Od**************@TK2MSFTNGP15.phx.gbl... First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link works probably because it is being treated like a web-link with your machine's server as the root. Again it's not correct. It shouldn't work. I don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message news:Om**************@TK2MSFTNGP10.phx.gbl... I've got a WebBrowser control in a C# Windows form. I build HTML on the fly and then set it into the control using the DocumentText property of the control. All of this works fine, except that part of the HTML that I construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the ability to link up to local files.
Thanks, Chris
Doubleclick on your inserted htm file to open it with IE (or whatever your
default browser is). Click on Test. Does a new instance of the browser
appear with SomeFile.htm or not? If yes, pay attention how you load the file
into the webcontrol. If no, check your html.
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
Yes, I tried everything I could thing of to come up with different paths and
even prepending the "file://" onto the front didn't help.
Any other ideas?
Chris
"AHN" <an****@excite.com> wrote in message
news:Od**************@TK2MSFTNGP15.phx.gbl... First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link works probably because it is being treated like a web-link with your machine's server as the root. Again it's not correct. It shouldn't work. I don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message news:Om**************@TK2MSFTNGP10.phx.gbl... I've got a WebBrowser control in a C# Windows form. I build HTML on the fly and then set it into the control using the DocumentText property of the control. All of this works fine, except that part of the HTML that I construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the ability to link up to local files.
Thanks, Chris
Doubleclick on your inserted htm file to open it with IE (or whatever your
default browser is). Click on Test. Does a new instance of the browser
appear with SomeFile.htm or not? If yes, pay attention how you load the file
into the webcontrol. If no, check your html.
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
Yes, I tried everything I could thing of to come up with different paths and
even prepending the "file://" onto the front didn't help.
Any other ideas?
Chris
"AHN" <an****@excite.com> wrote in message
news:Od**************@TK2MSFTNGP15.phx.gbl... First, you shouldn't crosspost.
Next, in your <A>, try 'href="file://C:\Temp\SomeFile.htm"'. The other link works probably because it is being treated like a web-link with your machine's server as the root. Again it's not correct. It shouldn't work. I don't like it, but never mind. :)
"Christopher D. Wiederspan" <wi********@reachdigital.com> wrote in message news:Om**************@TK2MSFTNGP10.phx.gbl... I've got a WebBrowser control in a C# Windows form. I build HTML on the fly and then set it into the control using the DocumentText property of the control. All of this works fine, except that part of the HTML that I construct is an <A> element that links to a local file, something like this:
<A HREF="C:\Temp\SomeFile.htm" TARGET="_blank">Test</A>
When I click on the link in the browser control, nothing happens.
After some experimentation, I've learned that if I share my Temp directory and then use this HTML instead, it works:
<A HREF="\\MyMachine\Temp\SomeFile.htm" TARGET="_blank">Test</A>
Can anybody give me some insight into this - I'm stuck without having the ability to link up to local files.
Thanks, Chris This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Christopher D. Wiederspan |
last post by:
I've got a WebBrowser control in a C# Windows form. I build HTML on the fly
and then set it into the control using the DocumentText property of the
control. All of this works fine, except that part...
|
by: news.austin.rr.com |
last post by:
hi
i am using the miscrosoft browser control on a windows form (win form) to
extract html content to a local html file. I use the browser control and
mshtml.IHTMLDocument2 as shown below.
...
|
by: Nathan |
last post by:
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).
The update...
|
by: Matt Walker |
last post by:
I decided to flesh out my php skills by building a web application
which could scan through local files on my intranet (specifically
mapped drives on my server) and generate a list of Movies or...
|
by: Alec MacLean |
last post by:
Hi,
I've created a small application for our company extranet (staff bulletins)
that outputs a list of links to PDF's that are stored in a SQL table. The
user clicks a link and the PDF is...
|
by: Lyle Fairfield |
last post by:
I am using Microsoft’s Web Browser Control embedded on an Access Form to
browse a specific site. I have a good reason for doing so; the pages on
this site run code which aborts their display unless...
|
by: Hexman |
last post by:
Hello All,
I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm
using some VB6 code, .Net2003 code,...
|
by: Jeff Gaines |
last post by:
I have spent the day learning how to use Zend Development Environment. I
can now produce a list of files in a directory, filtered by extension, and
apparently clickable. Unfortunately clicking on...
|
by: thirunavukarasukm |
last post by:
Hai.
I created one windows application.I am add reference control to add Microsoft WebBrowser Control..In my application I am using HTTPWebRequest and HttpWebResponse class .To request...
|
by: Salim Fadhley |
last post by:
A project I'm working on requires a Python egg to be deployed to a
remote location which (because of a security configuration outside my
control) denies users web-access but allows users access to...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |