Solved

ImageField in Gridview ASP.net 2.0

Posted on 2007-11-24
1
2,254 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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save ms data to server side. 19 55
vb.net winforms sizing/resolution? 4 39
C# MVC Insert Multiple Row into DB 2 30
Vb.net threads keep increasing 2 35
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

790 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