 |
| ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 30th, 2006, 04:16 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
File Link Won't Work
This link seems to do nothing when clicked:
<a target="Attachment" href="file:///c:\inetpub\wwwroot\Surveys\Attachments\TestAttachm ents\Control Test.xls">
Edit Control Test.xls
</a>
But pasting this into the address line in IE:
file:///c:\inetpub\wwwroot\Surveys\Attachments\TestAttachm ents\Control Test.xls
...gets the file immediately.
Can somebody explain why this is, and what I have to do to get the document to open in Excel from a link?
|
|

October 30th, 2006, 04:34 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
This is even stranger than I originally thought. The link rendered by ASP.NET doesn't work. But if I save the source of the ASP rendered page to my H/D and run that copy, the link works.
Clues anybody?
|
|

October 30th, 2006, 04:48 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
hi there.. what if you test
href="file:///c:\inetpub\wwwroot\Surveys\Attachments\TestAttachm ents\Control%20%Test.xls" ???
HTH
Gonzalo
|
|
The Following User Says Thank You to gbianchi For This Useful Post:
|
|
|

October 30th, 2006, 04:50 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
In the first example you are loading into a different window, a frame prehaps, that may or may not be you problem as I have never tried to load any type of file directly into a frame like that. (My methodology was normally to pass a doc ID to the frame, set up the correct headers, and then push the file out)
You said the link is rendered by the .net framework, does that mean to imply you are running your anchor tag as a server control?
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|
The Following User Says Thank You to dparsons For This Useful Post:
|
|
|

October 30th, 2006, 04:55 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
Tried replacing " " with "%20" already. Same result - doesn't work on the rendered page, works after saving the page to local H/d.
<A> tag is being written by VB.NET code - not hardcoded on page. Same old dynamically generated page issue.
|
|

October 30th, 2006, 04:57 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
So, your local environment structure mirrors that of your development environment? e.g. file:///c:\inetpub\wwwroot\Surveys\Attachments\TestAttachm ents\Control Test.xls exists the same in both places
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|
The Following User Says Thank You to dparsons For This Useful Post:
|
|
|

October 30th, 2006, 05:04 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
The environment where the problem is occuring is my local development enviroment. The path it's trying to link to is on the very same computer as VS, it's completely shared, etc. So, there is only one place for the file to exist. I can upload files to the path. I can delete files from the path. I can download by either pasting the link directly to the browser, or using the link after saving the .net source HTML to my local H/D (where the file exists), but not when the page is first returned to the browser from VS.
I cannot understand why the link does not work until after the HTML has been saved to my local H/D? What's the difference?
|
|

October 30th, 2006, 05:17 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Ahh it was a bit confusing when you said: saved to my local H/D It sounded as though you were working in 2 different environments.
My last suggestion would be to try a relative path as opposed to a direct path:
a href="./surveys/attachments/testattachments/control test.xls"
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|
The Following User Says Thank You to dparsons For This Useful Post:
|
|
|

October 30th, 2006, 05:23 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
|
|
Close.
href=".\Attachments\TestAttachments\Control Test.xls"
...opens the file, but in read only mode. I need to open it so that it can be saved back to its location. Is there some undocumented attribute I need to add to get it to do that?
|
|

October 30th, 2006, 05:41 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Uhh. While I am sure it is possible to do what you want to do, I know of no way of doing it. Because, essentially, what you are talking about is hosting the Excel runtime in the Browser environment with a "connected" state to the server.
The only way i know to get full perms is to download it to your machine.
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|
 |