Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-18
2
Medium Priority
?
1,384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 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