[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Container.dataitem with imagebutton

Posted on 2008-09-30
1
Medium Priority
?
757 Views
Last Modified: 2008-09-30
The code is in a datalist and bind by an array.

With the following code the container.dataitem works well:
(<a href="Imovel.aspx?foto=<%# Container.DataItem%>"> <img alt="" src="imgimo/<%# xid %>/<%# Container.DataItem %>")
 
But with the following code don´t work, i think the problem is the imagebutton control, and for some reasons i prefer use imagebutton control. What´s wrng.  
(asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/ImgImo/<%# Container.DataItem%>")
<ItemTemplate>
                                        <a href="Imovel.aspx?foto=<%# Container.DataItem%>"> <img alt="" src="imgimo/<%# xid %>/<%# Container.DataItem %>" border="0" width="168" height="168" /></a><br />
                                        <br />
                                        <asp:ImageButton ID="ImageButton1" runat="server" 
                                            ImageUrl="~/ImgImo/<%# Container.DataItem%>" PostBackUrl="~/imovel.aspx" Width="150px" />
                                        <br />
                                        <asp:Label ID="Label1" runat="server" Text="<%# left(Container.DataItem,len(Container.DataItem)-4) %>"></asp:Label>
                                    </ItemTemplate>

Open in new window

0
Comment
Question by:rflorencio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
David Robitaille earned 2000 total points
ID: 22606471

you need to string.concat the whole = string.
ImageUrl="~/ImgImo/<%# Container.DataItem%>")

ImageUrl='<%# string.concat("~/ImgImo/", DataBinder.Eval(Container.DataItem, "").tostring()) %>'  

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
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, …
Suggested Courses

649 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