469,945 Members | 2,333 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

Hyperlink imageURL not displaying URL

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
Nov 19 '05 #1
1 2480
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
"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Leigh Kendall | last post: by
reply views Thread by Ryan Harvey | last post: by
2 posts views Thread by Robson Carvalho Machado | last post: by
1 post views Thread by Nathan Sokalski | last post: by
5 posts views Thread by Patrick.O.Ige | last post: by
8 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by Nick Gilbert | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by Paul W Smith | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.