Advertisement

06.18.2008 at 03:36PM PDT, ID: 23497165
[x]
Attachment Details

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

Asked by michelle0 in Extensible Markup Language (XML), Microsoft Visual Basic.Net, .NET Framework 3.x versions

Tags: VB.NET

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,
KenStart Free Trial
1:
2:
3:
4:
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>)
[+][-]06.18.2008 at 03:57PM PDT, ID: 21817993

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 03:58PM PDT, ID: 21818003

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible Markup Language (XML), Microsoft Visual Basic.Net, .NET Framework 3.x versions
Tags: VB.NET
Sign Up Now!
Solution Provided By: michelle0
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628