PDA

View Full Version : Help with tidying this, please


SteveH
08-23-2008, 05:51 PM
Hello

I am having some problems trying to format an ASP script I have.

The portion of the script is as follows:

strHTML = strHTML & "<li><h1 class="title"><a target=""_blank"" href=""" & link & """>" _
&
strHTML = strHTML & "</a>"
strHTML = strHTML & "</h1>"
strHTML = strHTML & "</li>"
strHTML = strHTML & "<br>"


strHTML = strHTML & "<p class="description"></p></li>"
strHTML = strHTML & "<br>"
strHTML = strHTML & "<br> "
Next


I'm getting the following error:

Expected end of statement

strHTML = strHTML & "<li><h1 class="title">
------------------------------------^

I would be grateful for any help here.

Thanks.

Steve

miranda
08-23-2008, 07:30 PM
you must use two quotes when your string has quotes inside of it. This is the VB escape mechanism. So instead of class="title" you need class=""title""


otherwise what your asp sees is a string that says "<li><h1 class=" at that point, since you haven't escaped your quote it expects a concatenation operator.

SteveH
08-25-2008, 03:55 PM
Many thanks for that Miranda.

I had a similar line below the 'title' called 'description' and applied the double quotation marks to that too and it seems to be working nicely now.

Thank you.

Steve