Dumb ASP Syntax Question

Results 1 to 3 of 3

Thread: Dumb ASP Syntax Question

  1. #1
    Join Date
    Dec 1969

    Default Dumb ASP Syntax Question

    I am trying to put an HTML string into a variable as a string. The problem is that the HTML string has a set of double qoutes in it and the ASP variable treats double quotes as the end of the string. What is the special character series to allow the double qoutes to be stored in a string?<BR><BR>Variable = "&#060;a href="mailto:name@homtail.com"&#062;" + TextStringVariable + "&#060;/a&#062;"<BR><BR>The compiler gives an error on the first set of double qoutes around the mailto tag becasue it expects that to be the end of the string.<BR><BR>Thanks,<BR>Jeff

  2. #2
    Dick Wong Guest

    Default RE: Dumb ASP Syntax Question

    Variable = "&#060;a href="mailto:name@homtail.com"&#062;" + TextStringVariable + "&#060;/a&#062;"<BR><BR>Have you try like this:<BR>Variable = "&#060;a href=&#039mailto:name@homtail.com&#039&#062;" + TextStringVariable + "&#060;/a&#062;"<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Dumb ASP Syntax Question

    In this particular case, you can use a single quote &#039 in place of a double quote. I do this a lot in JavaScript too.<BR><BR>However, for future reference, if you want a double quote to appear in a string, use "" ... the server treats two in a row as a literal. This gets confusing sometimes when you are opening and closing quotes around the quote literal, e.g.<BR>select * from tbMyTable where """ & fieldName & """ = """ & fieldName2 & """"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts