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" >
           <Columns>

                <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" />
               
                <asp:HyperLinkField
                    DataNavigateUrlFields="fldID"
                    DataNavigateUrlFormatString="~/Results.aspx?id={0}"
                    Text="Labs" />

            </Columns>

        </asp:GridView>

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.

Colin
cjmackenzieAsked:
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" />

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

Colin
0
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.