vinyl-junkie
02-25-2006, 05:52 PM
I have a HyperlinkColumn that right now only displays one database field (Artist) on my web page but I would like for it to display two database fields (The and Artist). I have found documentation for formatting a single field, but I can't find anything that will take in two fields. Is this even possible? If so, could you post some sample code for how to do that.
Here is the code I'm using right now:
<asp:HyperLinkColumn
DataNavigateUrlField="ArtistID"
DataNavigateUrlFormatString="MusicDBSearch.aspx?ArtistID={0}"
DataTextField="Artist" HeaderText="Artist"
ItemStyle-Width="38%">
<HeaderStyle CssClass="row2left"></HeaderStyle>
</asp:HyperLinkColumn>
So, for example, the link value currently says Corrs, and the link itself will be:
MusicDBSearch.aspx?ArtistID=74.
What I would like for the link value to say is The Corrs, but I only want the The database field to be displayed if it's populated. Does that make sense?
FWIW, I did find some documentation for ASP.NET 2.0 that would take in two fields for the URL of the HyperlinkColumn, but apparently you can't do the same thing on the HeaderTextField. I'm still using ASP.NET 1.1 but will soon be on 2.0, if that makes any difference.
In any event, whatever help you can provide would be appreciated.
Here is the code I'm using right now:
<asp:HyperLinkColumn
DataNavigateUrlField="ArtistID"
DataNavigateUrlFormatString="MusicDBSearch.aspx?ArtistID={0}"
DataTextField="Artist" HeaderText="Artist"
ItemStyle-Width="38%">
<HeaderStyle CssClass="row2left"></HeaderStyle>
</asp:HyperLinkColumn>
So, for example, the link value currently says Corrs, and the link itself will be:
MusicDBSearch.aspx?ArtistID=74.
What I would like for the link value to say is The Corrs, but I only want the The database field to be displayed if it's populated. Does that make sense?
FWIW, I did find some documentation for ASP.NET 2.0 that would take in two fields for the URL of the HyperlinkColumn, but apparently you can't do the same thing on the HeaderTextField. I'm still using ASP.NET 1.1 but will soon be on 2.0, if that makes any difference.
In any event, whatever help you can provide would be appreciated.