Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Datagrid broken link

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mel - 11 Apr 2008 19:38 GMT
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
Mel - 11 Apr 2008 21:23 GMT
> 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
[quoted text clipped - 22 lines]
> </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.
Theo - 13 Apr 2008 01:17 GMT
> 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
[quoted text clipped - 22 lines]
> </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.
Mel - 14 Apr 2008 13:53 GMT
> > 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
[quoted text clipped - 27 lines]
> a page in your site that does nothing but fetch and pass on files from
> a specified location.

Could you provide an example?
Mel - 21 Apr 2008 18:44 GMT
> > > 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
[quoted text clipped - 29 lines]
>
> Could you provide an example?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.