• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2265
  • Last Modified:

ImageField in Gridview ASP.net 2.0

I would like an external target URL to be assigned to this field when it autopopulates. However, I can't find a field option for this inside gridview -> edit columns, etc. Any suggestions.
0
jumpstart0321
Asked:
jumpstart0321
1 Solution
 
MikeMCSDCommented:
You need a  TemplateField. Try this:


    <asp:TemplateField>
      <ItemTemplate>
        <asp:HyperLink Target="_blank"  runat="server" ID="link" NavigateUrl='<%# "../CatalogAdmin.aspx?DepartmentID=" + Request.QueryString["DepartmentID"] + "&amp;CategoryID=" + Eval("CategoryID")%>' Text="View Products">
<img src='ProductImages/<%# Eval("Image1FileName") %>' />
        </asp:HyperLink>
      </ItemTemplate>
    </asp:TemplateField>

Open in new window

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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now