tags:

views:

17

answers:

1

I would like to add a variable data to a string literal WITHIN the HTML tag

Dim locationOfImage as string = "http://blahblah......" 
Dim xmlString = _
            <div style="background:url(" <%= locationOfImage  %> ")">
                <h3>Some text</h3>

            </div>

The above does not work, I can't quickly determine how to do this? Is this possible. I could achieve what I am attempting to do with a StringBuilder but want to use the xml literal if possible.

A: 
<div style="<%= String.Format("background:url('{0}')", locationOfImage)  %>">
Joachim VR