View Single Post
  #1 (permalink)  
Old May 27th, 2006, 06:51 PM
zuz29 zuz29 is offline
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)

----------------------------
<comments>
      <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." />
    </comments>
---------------------------

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.