Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...ImageField DonImageField Don't work correctly whit GridView
Previous
 
Next
New Post
4/21/2009 5:11 PM
 

Hello

I wont to display Image in a GRIDVIEW throw an ImageField.

In the data base I stored the filepath in the field:      Photo Nvarchar(100)

I create a folder in my projet directory named Images

So the Image row code in my grid view is like this:

<asp:imagefield dataimageurlfield="Photo"
            dataimageurlformatstring="~\Images\{0}.jpg"
            alternatetext="Employee Photo"
            nulldisplaytext="No image on file."
            headertext="Photo" 
            readonly="true"/>

I didn't put any relative code behind for this cause, and I think that's the cause of having always the value of the alternatetext. Can you help to correct this mistake please! I didn't find any document concerning this case in the internet for 3 day :( and I'm steal searching...

I also tried an other way but the Images don't appear. I also didn't use a code behin for this!

<asp:TemplateField HeaderText="Photo" SortExpression="Photo">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox5" runat="server"   Text='<%# Bind("Photo") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                &nbsp;<asp:Image ID="Image1" runat="server"  Height="75px"  ImageUrl='<%# Eval("Photo") %>' />
            </ItemTemplate>
        </asp:TemplateField>

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...ImageField DonImageField Don't work correctly whit GridView


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out