Solved

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

Posted on 2008-06-18
2
1,377 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
ID: 21817993
Perhaps try
src=<%= "https://www.server1.com/ImageHandler.ashx?code=" & x.ProductCode %>
0
 
LVL 1

Accepted Solution

by:
michelle0 earned 0 total points
ID: 21818003

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

19 Experts available now in Live!

Get 1:1 Help Now