p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Basics (http://p2p.wrox.com/forumdisplay.php?f=136)
-   -   use datalist via xml to show picture in output (http://p2p.wrox.com/showthread.php?t=43099)

zuz29 May 27th, 2006 06:51 PM

use datalist via xml to show picture in output
Using Visual Studio 5.0 & c#, I have a standard XML file that I am loading into a .NET Datalist. One of the elements in the XML is the name of the accompanying image, e.g. 'xyz.jpeg'. However, when I run the aspx, it puts everything in <span> tags and just outputs the text 'xyz.jpg'

1- Is there a default method already arranged to display picture elements (from the xml) in a DataList control?

2-If not, I came to a partial workaround by inputting this directly into the XML file itself: (I coudln't get the CDATA tag to work)

      <userComment rating="4"
          comment="&lt;/span&gt;&lt;img src=&quot;Family-Crest.jpg&quot; align=&quot;left&quot;&gt; Best translation I've read." />
      <userComment rating="2"
          comment="I like other versions better." />

which is just basically closing .NET's <span> tag so the picture gets translated as plain html. Problem is I can't get the text 'Best translation... etc' to wrap around the image as it is not technically in the same cell etc.

What is the best way to accomplish the end result?

(Here is the DataList layout I am trying to get to:)
  PIC | text text text text text
  PIC | texttext text text etx tex
  PIC | text testestextext textex
textex text text text tex tex text
text text text text.

All times are GMT -4. The time now is 09:16 PM.

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