I have a grid view using bound, hyper link, and template fields.
I'm trying to figure out how to include two dynamic items in the NavigateURL properly of both the Lo-Fi:HyperLink
control and the Hi-Fi:HyperLink
control I know how to do this with a HyperLinkField field as I do in the second two columns but I can't use that inside the template column.
I need to concatenate the <%# Eval("Locker_LO_Filename")%>
item I'm using for the text property onto the end of the URL where the {1} is currently.
<asp:GridView ID="gvLocker" runat="server" HeaderStyle-BackColor="Goldenrod"
HeaderStyle-ForeColor="DarkBlue" AlternatingRowStyle-BackColor="Cornsilk"
Font-Names="Verdana,arial,helvetica" AutoGenerateColumns="False" Font- Size="13px" Width="640px" BorderColor="#404040">
<Columns>
<asp:BoundField DataField="memid" HeaderText="MemID" ReadOnly="True" SortExpression="memid"
Visible="False" HeaderStyle-Font-Size="13px" />
<asp:HyperLinkField DataNavigateUrlFormatString="myLockerEditSong.aspx?ID={0}&li={1}"
DataTextField="EditIt" DataNavigateUrlFields="memid,lockid" HeaderStyle-Font-Size="13px">
<ItemStyle Width="65px" Font-Size="13px" />
</asp:HyperLinkField>
<asp:HyperLinkField DataNavigateUrlFormatString="myLockerDeleteSong.aspx?ID={0}&li={1}"
DataTextField="Delete" DataNavigateUrlFields="memid,lockid" HeaderStyle-Font-Size="13px">
<ItemStyle Width="65px" Font-Size="13px" />
</asp:HyperLinkField>
<asp:TemplateField HeaderText="Song Information" HeaderStyle-Font-Size="13px">
<ItemTemplate>
<strong><asp:Label ID="Label1" runat="server" Text='<%# Eval("Locker_Title") %>'></asp:Label></strong><br />
Lo-Fi:<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("memid", "/uploads/{0}/Locker/LoFi/{1}") %>'
Text='<%# Eval("Locker_LO_Filename") %>' Font-Size="13px"></asp:HyperLink><br />
Hi-Fi:<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("memid", "/uploads/{0}/Locker/HiFi/{1}") %>'
Text='<%# Eval("Locker_HI_Filename") %>' Font-Size="13px"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="350px" Font-Size="13px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="File Information" SortExpression="Locker_UploadDate" HeaderStyle-Font-Size="13px">
<ItemTemplate>
<strong>Uploaded:</strong> <asp:Label ID="Label2" runat="server" Text='<%# Eval("Locker_UploadDate") %>'></asp:Label><br />
<strong>Modified:</strong> <asp:Label ID="Label3" runat="server" Text='<%# Eval("Locker_DateLastModified") %>'></asp:Label>
<ItemStyle Font-Size="13px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#FFDF59" ForeColor="Maroon" HorizontalAlign="Left" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>