Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ImageField in Gridview ASP.net 2.0

Posted on 2007-11-24
1
Medium Priority
?
2,259 Views
Last Modified: 2013-11-26
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
Comment
Question by:jumpstart0321
1 Comment
 
LVL 16

Accepted Solution

by:
MikeMCSD earned 2000 total points
ID: 20344374
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

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question