Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Quotes/Double Quotes in Image Control

Reply
Thread Tools

Quotes/Double Quotes in Image Control

 
 
Chris White
Guest
Posts: n/a
 
      09-22-2004
I'm trying to put a dynamic image inside a Data Repeater.

<asp:Repeater id="repModels" runat="server">
<ItemTemplate>
<asp:Image id="Image1" runat="server" ImageUrl="images/cars/small/<%#
Databinder.Eval(Container.DataItem, "Picture") %>">
</asp:Image>
</ItemTemplate>
</asp:Repeater>

This was giving me Parser Error Message: The server tag is not well formed
After doing some searching, I replaced the outer double quotes with single
quotes

<asp:Repeater id="repModels" runat="server">
<ItemTemplate>
<asp:Image id="Image1" runat="server" ImageUrl='images/cars/small/<%#
Databinder.Eval(Container.DataItem, "Picture") %>'>
</asp:Image>
</ItemTemplate>
</asp:Repeater>

This doesn't work, the Databinder.Eval does not even get parsed.
And why does the above Not work and the code below does?

<asp:Repeater id="repModels" runat="server">
<ItemTemplate>
<asp:HyperLink id="Hyperlink1" NavigateUrl='' Text='<%#
Databinder.Eval(Container.DataItem, "Picture") %>' Runat="server">
</asp:HyperLink>
</ItemTemplate>
</asp:Repeater>

And finally, is there any real benefit using an asp:Image tag instead of an
img tag?


 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      09-22-2004
try this
<asp:Repeater id="repModels" runat="server">
<ItemTemplate>
<asp:Image id="Image1" runat="server" ImageUrl='<%#
"images/cars/small/ " +
Databinder.Eval(Container.DataItem, "Picture") %>'>
</asp:Image>
</ItemTemplate>
</asp:Repeater>

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Chris White" <chrisjwhite@@@mindspring...com> wrote in message
news:#(E-Mail Removed)...
> I'm trying to put a dynamic image inside a Data Repeater.
>
> <asp:Repeater id="repModels" runat="server">
> <ItemTemplate>
> <asp:Image id="Image1" runat="server" ImageUrl="images/cars/small/<%#
> Databinder.Eval(Container.DataItem, "Picture") %>">
> </asp:Image>
> </ItemTemplate>
> </asp:Repeater>
>
> This was giving me Parser Error Message: The server tag is not well formed
> After doing some searching, I replaced the outer double quotes with

single
> quotes
>
> <asp:Repeater id="repModels" runat="server">
> <ItemTemplate>
> <asp:Image id="Image1" runat="server" ImageUrl='images/cars/small/<%#
> Databinder.Eval(Container.DataItem, "Picture") %>'>
> </asp:Image>
> </ItemTemplate>
> </asp:Repeater>
>
> This doesn't work, the Databinder.Eval does not even get parsed.
> And why does the above Not work and the code below does?
>
> <asp:Repeater id="repModels" runat="server">
> <ItemTemplate>
> <asp:HyperLink id="Hyperlink1" NavigateUrl='' Text='<%#
> Databinder.Eval(Container.DataItem, "Picture") %>' Runat="server">
> </asp:HyperLink>
> </ItemTemplate>
> </asp:Repeater>
>
> And finally, is there any real benefit using an asp:Image tag instead of

an
> img tag?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I Add quotes to values in a array? or include quotes.. Richard Sandoval Ruby 5 04-26-2011 09:30 PM
regex to avoid escaped quotes or double quotes jOhn Ruby 1 01-29-2008 08:31 PM
PHP double quotes inside double quotes MSB Computer Support 11 10-21-2006 01:09 PM
Asp.NET Javascript string, want to pass '(single quotes' within '(single quotes) Chris ASP .Net 1 03-24-2006 09:03 PM
Multiline quotes - escaping quotes - et al Lawrence Tierney Java 3 12-24-2003 05:12 PM



Advertisments