I'm sure this is a dumb question to a simple problem, but for some reason I cannot get this to work on ASP2.
I'm pulling a link to an image on my local network from a database, and inserting that link into a hyperlink control. I've done the same on ASP1, and have never had any problems like this. Searching the web I only came across a KB related to FrontPage 2000
requiring an update.
I'm not sure that you can display an image that's not on the server, I think you should upload the image to your server first. Then bind the imageURL property to the image path on the server.
I don't really need to render an image I just need for the user to be able to enter
and click "G:\My Projects" and have a pop-up window open the network folder.
This works file unless there are spaces in the URL:
G:\ - works
G:\MyDirectory - works
G:\My Directory - fails, it renders G:\My%2520Directory when it should render G:\My%20Directory
xmanxs
Member
5 Points
1 Post
%2520 in navigateURL preventing navigate to image on network share
Jul 08, 2005 05:00 PM|LINK
I'm pulling a link to an image on my local network from a database, and inserting that link into a hyperlink control. I've done the same on ASP1, and have never had any problems like this. Searching the web I only came across a KB related to FrontPage 2000 requiring an update.
Target share: "\\server\share name\image.jpg"
Hyperlink displays: \\server\share%20name\image.jpg (copying this string to a browser works fine)
On click, hyperlink attempts navigate to: \\server\share%2520\image.jpg (results in cannot find file error)
I've tried using "file://" in the DataNavigateUrlFormatString, as well as using no format string, but encounter the same result.
Any assistance would be greatly appreciated.
-S
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: %2520 in navigateURL preventing navigate to image on network share
Jul 08, 2005 07:02 PM|LINK
can you tell us how you're setting the link?
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
TacRedline
Member
177 Points
300 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 09:04 PM|LINK
I'm having the same error, any advice on this?
<EditItemTemplate>
<asp:TextBox ID="TextBoxFilesDir" runat="server" Text='<%# Bind("FilesDir") %>' Visible="True">
</asp:TextBox><br />
</EditItemTemplate>
BasharKokash
Participant
1798 Points
294 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 09:21 PM|LINK
try to add the symbol '~' before the image path
TacRedline
Member
177 Points
300 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 09:28 PM|LINK
from G:\my dir
to
~G:\my dir
this didn't work but i'm not sure if that's what you meant...
i also tried:
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("FilesDir") %>' NavigateUrl='<%# Eval("FilesDir") %>' id="HyperLink2" target="_blank"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
BasharKokash
Participant
1798 Points
294 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 09:44 PM|LINK
Let me explain,
usually when you save the image path you don't save the entire path but the part after the root of the site
for example:
g:\mysite\images\im.jpg
we save only "\image\im.jpg" now when you want to display this image you should use imageURL = "~\image\im.jpg"
TacRedline
Member
177 Points
300 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 09:52 PM|LINK
I see.
But the user can type in a drive path:
e.g. G:\My Directory
the files are not on the same server as the web application, they are on the windows network the user is logged in to
G:\ - works
G:\MyDirectory - works
G:\My Directory - fails
BasharKokash
Participant
1798 Points
294 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 06, 2007 10:12 PM|LINK
I'm not sure that you can display an image that's not on the server, I think you should upload the image to your server first. Then bind the imageURL property to the image path on the server.
TacRedline
Member
177 Points
300 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 07, 2007 01:10 PM|LINK
Maybe I should of started a new thread.
I don't really need to render an image I just need for the user to be able to enter and click "G:\My Projects" and have a pop-up window open the network folder.
This works file unless there are spaces in the URL:
G:\ - works
G:\MyDirectory - works
G:\My Directory - fails, it renders G:\My%2520Directory when it should render G:\My%20DirectoryMake sense?
Thanks!
BasharKokash
Participant
1798 Points
294 Posts
Re: %2520 in navigateURL preventing navigate to image on network share
Aug 07, 2007 04:45 PM|LINK
I realy want to give help
could you please post the cold that makes the cases without spaces work.