Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2005, 04:22 PM
Authorized User
 
Join Date: Jan 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding controls into a Repeaters <ItemTemplate>

Hi,

How do I add an imagebutton, hyperlink control, etc into a repeater? I wrote this:

<asp:ImageButton id=ImageButton2 runat="server" ImageUrl='UserImages/'+<%# DataBinder.Eval(Container.DataItem, "image") %>></asp:ImageButton>

But I get this message:

Parser Error Message: The server tag is not well formed.

Any ideas?

-- JQ

 
Old March 7th, 2005, 05:26 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I think you have an extra ">" in your code

 
Old April 15th, 2005, 09:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When you are doing concatenation in a bound control do it like this:

<asp:ImageButton id=ImageButton2 runat="server" ImageUrl='<%# "UserImages/" + DataBinder.Eval(Container.DataItem, "image") %>'></asp:ImageButton>

I think you could also do it this way:

<asp:ImageButton id=ImageButton2 runat="server" ImageUrl='UserImages/<%# DataBinder.Eval(Container.DataItem, "image") %>'></asp:ImageButton>


-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
Adding a <p> in text that has no xml tags dzisaacs XSLT 1 November 1st, 2005 02:14 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.