J
Jim in Arizona
This has something to do with my previous post titled "virtual directory and
hyperlink file path issue (listed and linked paths don't match)".
In the aspx page, I have this datagrid code:
--
<aspataGrid id="dgFiles" runat="server" Font-Names="Tahoma"
AutoGenerateColumns="false" AlternatingItemStyle-BackColor="AliceBlue"
HeaderStyle-BackColor="Beige" HeaderStyle-ForeColor="Black"
HeaderStyle-font-size="10pt" HeaderStyle-Font-Bold="true">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name"
HeaderText="File Name" />
<asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundColumn DataField="Length" HeaderText="File Size"
ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,### bytes}" />
</Columns>
</aspataGrid>
--
The hyperlink is showing a path such as
http://mysite.com/companyfiles/filename.doc and instead should be showing
http://mysite.com/companyfiles/files/filename.doc. I'm trying to append the
files directory name within the HyperLinkColumn code above in a way like
this:
<asp:HyperLinkColumn DataNavigateUrlField='<%Response.Write("/files/") &
"Name" %>' DataTextField="Name" HeaderText="File Name" />
so that the URL comes out right. I can't seem to find the proper way of
doing it without causing an error.
This whole thing has become very frustrating in that it appears to be a
glitch!
In the code behind, when I have code like this:
Dim dirinfo As New DirectoryInfo(Server.MapPath("./files/"))
dgFiles.DataSource = dirinfo.GetFiles()
dgFiles.DataBind()
The files inside the files directory are displayed fine but the hyperlink is
pointing to the directory above it where the aspx file resides!
Any ideas anyone?
TIA,
Jim
hyperlink file path issue (listed and linked paths don't match)".
In the aspx page, I have this datagrid code:
--
<aspataGrid id="dgFiles" runat="server" Font-Names="Tahoma"
AutoGenerateColumns="false" AlternatingItemStyle-BackColor="AliceBlue"
HeaderStyle-BackColor="Beige" HeaderStyle-ForeColor="Black"
HeaderStyle-font-size="10pt" HeaderStyle-Font-Bold="true">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name"
HeaderText="File Name" />
<asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundColumn DataField="Length" HeaderText="File Size"
ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,### bytes}" />
</Columns>
</aspataGrid>
--
The hyperlink is showing a path such as
http://mysite.com/companyfiles/filename.doc and instead should be showing
http://mysite.com/companyfiles/files/filename.doc. I'm trying to append the
files directory name within the HyperLinkColumn code above in a way like
this:
<asp:HyperLinkColumn DataNavigateUrlField='<%Response.Write("/files/") &
"Name" %>' DataTextField="Name" HeaderText="File Name" />
so that the URL comes out right. I can't seem to find the proper way of
doing it without causing an error.
This whole thing has become very frustrating in that it appears to be a
glitch!
In the code behind, when I have code like this:
Dim dirinfo As New DirectoryInfo(Server.MapPath("./files/"))
dgFiles.DataSource = dirinfo.GetFiles()
dgFiles.DataBind()
The files inside the files directory are displayed fine but the hyperlink is
pointing to the directory above it where the aspx file resides!
Any ideas anyone?
TIA,
Jim