Hyperlink imageURL not displaying URL

T

tshad

Is there some reason why the Hyperlink in a DataGrid will not show an image?

I have a datagrid with the following:

<asp:TemplateColumn visible="false" HeaderText="Skills">
<itemtemplate>
<asp:HyperLink id="SkillsTestDate"
imageURL="../images/checkmark.gif" visible="false" Text='<%#
Container.DataItem("SkillsTestDate")%>' NavigateUrl='<%#
"displayAppResumeEE2.aspx?JobID" & Container.DataItem("JobID") %>'
runat='server'/>
</itemtemplate>
</asp:TemplateColumn>

They work fine as:

<asp:TemplateColumn ItemStyle-VerticalAlign="top"
ItemStyle-HorizontalAlign="center" HeaderText="Skills<br>Taken"
ItemStyle-Width="45">
<itemtemplate>
<asp:Image id="SkillsImage" runat="server"
AlternateText="Image Text"
Visible="false"
width="16px"
Height="16px"
ImageUrl="../images/checkmark.gif"/>
</itemtemplate>

Same path, but for some reason the Hyperlink is not showing it, even though
MS says it is one of the properties.

Is there something you have to do to turn it on?

Thanks,

Tom
 
T

tshad

This seems to be working now.

Not sure what was happening. I haven't changed anything and can only assume
there was some caching problem or something (although that doesn't make
sense since other changes were showing up).

I do have a problem getting the Hyperlink to apply width and height to the
image. I made some changes to one of the checkmark images to display as
width and height of 16px. The problem is these are not being rendered. I
did add them in by hand to the view source and displaying the page. This
worked fine.

Here is the original lines:

<asp:TemplateColumn visible="true" ItemStyle-VerticalAlign="top"
ItemStyle-HorizontalAlign="center" HeaderText="Application">
<itemtemplate>
<asp:HyperLink id="ApplicationDate" visible="true"
ImageUrl="../images/checkmark.gif" width="16px" height="16px" Text='<%#
Container.DataItem("ApplicationDate")%>' NavigateUrl='<%#
"displayAppResumeEE2.aspx?JobID" & Container.DataItem("JobID") %>'
runat='server'/>
</itemtemplate>
</asp:TemplateColumn>

But the rendered code is:

</td><td align="Center" valign="Top">
<a id="DataGrid1__ctl2_ApplicationDate"
href="displayAppResumeEE2.aspx?JobID3737"><img src="../images/checkmark.gif"
alt="25Feb05" border="0" /></a>

Where is the width and height? They are valid properties according to MS.
If this is not the case, where how would I set this so that the images are
sized correctly?

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top