Can I put an image in a HyperLinkField?

I have a gridview like this:

                <asp:GridView ID="PatientList1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="PDAGetPatientList" AllowSorting="True" >

                <asp:BoundField DataField="fldLastName" HeaderText="Last Name" SortExpression="fldLastName" />

                <asp:BoundField DataField="fldFirstName" HeaderText="First Name" SortExpression="fldFirstName" />

                <asp:HyperLinkField DataNavigateUrlFields="fldID" DataNavigateUrlFormatString="Details.aspx?ID={0}"
                    DataTextField="fldID" HeaderText="ID" SortExpression="fldID" />
                    Text="Labs" />



I want my second hyperlink to be an image rather than text. How do I do this? A HyperLinkField doesn't appear to have an image property.

Who is Participating?
mirmansoorConnect With a Mentor Commented:
In the text property try writing an img tag and check.. i think it should work

HeaderText =<img src="yourimg.jpg" />

cjmackenzieAuthor Commented:
Thank-you. Seems obvious now. Thanks for the prompt answer.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.