Datagrid broken link

M

Mel

I have a datagrid control that has one column displaying a filename.
When the link is clicked it opens the file. How do I open a file that
resides on a remote server? The code below does not work. When I
click the link I get error #404 Page Not Found. PLEASE HELP!

'start of example code. The FullName = "\\SalesServer\Quotes
\123456\<file name>"
<asp:DataGrid runat="server" id="dgQuote" Font-Names="Verdana"
AutoGenerateColumns="False" AlternatingItemStyle-
BackColor="#eeeeee"
HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
HeaderStyle-Font-Size="15pt" HeaderStyle-Font-Bold="True"
AllowPaging="True" AllowSorting="True" Font-Size="Small"
CellPadding="2">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="FullName"
DataTextField="Name"
HeaderText="File Name" />
</Columns>
<SelectedItemStyle BackColor="#C5BBAF" />
<PagerStyle HorizontalAlign="Center" />
<AlternatingItemStyle BackColor="#E3EAEB" />
<HeaderStyle BackColor="#1C5E55" Font-Size="Small"
ForeColor="White" Font-Bold="True" />
</asp:DataGrid>
'end of example code
 
M

Mel

I have a datagrid control that has one column displaying a filename.
When the link is clicked it opens the file. How do I open a file that
resides on a remote server? The code below does not work. When I
click the link I get error #404 Page Not Found. PLEASE HELP!

'start of example code. The FullName = "\\SalesServer\Quotes
\123456\<file name>"
<asp:DataGrid runat="server" id="dgQuote" Font-Names="Verdana"
AutoGenerateColumns="False" AlternatingItemStyle-
BackColor="#eeeeee"
HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
HeaderStyle-Font-Size="15pt" HeaderStyle-Font-Bold="True"
AllowPaging="True" AllowSorting="True" Font-Size="Small"
CellPadding="2">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="FullName"
DataTextField="Name"
HeaderText="File Name" />
</Columns>
<SelectedItemStyle BackColor="#C5BBAF" />
<PagerStyle HorizontalAlign="Center" />
<AlternatingItemStyle BackColor="#E3EAEB" />
<HeaderStyle BackColor="#1C5E55" Font-Size="Small"
ForeColor="White" Font-Bold="True" />
</asp:DataGrid>
'end of example code

I should have said "How do I open a file that resides on a DIFFERENT
server" meaning the server is on site; NOT a remote server which
implies off site.
 
T

Theo

I have a datagrid control that has one column displaying a filename.
When the link is clicked it opens the file. How do I open a file that
resides on a remote server? The code below does not work. When I
click the link I get error #404 Page Not Found. PLEASE HELP!

'start of example code. The FullName = "\\SalesServer\Quotes
\123456\<file name>"
<asp:DataGrid runat="server" id="dgQuote" Font-Names="Verdana"
AutoGenerateColumns="False" AlternatingItemStyle-
BackColor="#eeeeee"
HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
HeaderStyle-Font-Size="15pt" HeaderStyle-Font-Bold="True"
AllowPaging="True" AllowSorting="True" Font-Size="Small"
CellPadding="2">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="FullName"
DataTextField="Name"
HeaderText="File Name" />
</Columns>
<SelectedItemStyle BackColor="#C5BBAF" />
<PagerStyle HorizontalAlign="Center" />
<AlternatingItemStyle BackColor="#E3EAEB" />
<HeaderStyle BackColor="#1C5E55" Font-Size="Small"
ForeColor="White" Font-Bold="True" />
</asp:DataGrid>
'end of example code

You need to convert the file name into something that the browser can
resolve. That could mean converting the UNC path to a URL, or having
a page in your site that does nothing but fetch and pass on files from
a specified location.
 
M

Mel

You need to convert the file name into something that the browser can
resolve. That could mean converting the UNC path to a URL, or having
a page in your site that does nothing but fetch and pass on files from
a specified location.

Could you provide an example?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top