Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp.net gridview image link

Status
Not open for further replies.

jondow

Programmer
Oct 19, 2006
45
GB
Hello,

I have the following grid view (using VS 2005 - VB.NET):

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="2"
DataSourceID="SqlDataSourceAD" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True" Font-Size="Small" PageSize="25">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Wrap="True" />
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="sAMAccountName" DataTextField="displayName" DataTextFormatString="{0}" HeaderText="Colleague" SortExpression="displayName" DataNavigateUrlFormatString="details.aspx?AccountName={0}" />
<asp:BoundField DataField="ipPhone" HeaderText="Extention" SortExpression="ipPhone" />
<asp:BoundField DataField="mobile" HeaderText="Mobile" SortExpression="mobile" />
<asp:BoundField DataField="title" HeaderText="Role" SortExpression="title" />
<asp:BoundField DataField="department" HeaderText="Department" SortExpression="department" />
<asp:BoundField DataField="Secretary" HeaderText="Secretary" SortExpression="Secretary" />
<asp:BoundField DataField="physicalDeliveryOfficeName" HeaderText="Office" SortExpression="physicalDeliveryOfficeName" />
<asp:HyperLinkField DataNavigateUrlFields="mail" DataTextField="mail" DataTextFormatString="&lt;a href=mailto:{0}&gt;{0}&lt;/a&gt;" HeaderText="Email" SortExpression="mail" />
</Columns>


<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>


The final column contains an email link - I'd like to be able to replace the text with an image (email.jpg) so that the image provides the mailto: link but cant get it to work. Anyone have any ideas?

Thanks In Advance.

Rick
 
Try posting this in the ASP .NET forum:

forum855



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top