Solved

ASP.NET VB.NET and using a code block for CDATA in XML

Posted on 2008-06-18
2
1,376 Views
Last Modified: 2013-11-07
I want to use a code block <%= %> to specify a string in a CDATA node of an xml doc.  I am using VB.NET, so I am writing the XML directly in the response (VS2008).

The first example WORKS.  The 2nd example DOES NOT.  The difference is that I am using a code block to get the Product code for my url in the CDATA text node.

Ideas?  I prefer NOT to create the XML doc itself as I have a whole lot of these to develop and prefer to use the slick VB.NET xml editing feature for the Write method.

TIA,
Ken
Response.Write(<description><![CDATA[<img align='left' src='https://www.server1.com/ImageHandler.ashx?code=192932'/>]]><%= Left(x.ProductDesc, 180) %>...</description>)
 
 

Response.Write(<description><![CDATA[<img align='left' src='https://www.server1.com/ImageHandler.ashx?code=<%= x.ProductCode %>'/>]]><%= Left(x.ProductDesc, 180) %>...</description>)

Open in new window

0
Comment
Question by:michelle0
2 Comments
 
LVL 24

Expert Comment

by:Jeff Certain
Comment Utility
Perhaps try
src=<%= "https://www.server1.com/ImageHandler.ashx?code=" & x.ProductCode %>
0
 
LVL 1

Accepted Solution

by:
michelle0 earned 0 total points
Comment Utility

I GOT IT!

Response.Write(<description><%= New XCData("<img align='left' src='https://www.server1.com/ImageHandler.ashx?code=" & x.ProductCode & "'/>") %><%= Left(x.ProductDesc, 180) %>...</description>)
 
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now