Results 1 to 2 of 2

Thread: single quotes and double quotes in ASP

  1. #1
    Dave Classick Guest

    single quotes and double quotes in ASP


    Can any one tell me if when doing a Response.Write,
    do single quotation marks need quotes around them, ie

    the code:
    Response.Write &#34;<SELECT NAME=&#34;&#34;manufacturer&#34;&#34; SIZE=15>&#34;
    will print: SELECT NAME=&#34;manufacturer&#34; SIZE=15>

    but what if i wanted to print something like:

    <option value=&#34;&#39;Frame_A&#39;,&#39;location_belmont .htm&#39;&#34;>Belmont</option>

    i keep getting messed up with the single quotes

  2. #2
    Rick Ryan Guest

    single quotes and double quotes in ASP (reply)

    Dave,

    I found that ASPdb was unable to support updates of text/string fields containing single quotes until version ASPDB2001.02.21.SP3 was released. Embedded single quotes are now handled correctly.

    This is the current behavior I have observed:

    Value in Field Value Stored
    ---------------------- ---------------------------
    &#39;AB&#39;,&#39;CD&#39; AB&#39;,&#39;CD
    AB&#39;,&#39;CD&#39; AB&#39;,&#39;CD&#39;
    &#39;AB&#39;,CD AB&#39;,CD
    &#39;&#39;AB&#39;,&#39;CD&#39; &#39;AB&#39;,&#39;CD&#39;
    &#39;&#39;AB&#39;,&#39;CD&#39;&#39; &#39;AB&#39;,&#39;CD&#39;

    If the string you are placing into the field begins with doubled single quotes, the single quotes are handled correctly (or at least the way I think they ought to be handled).

    I have not experienced any problems retrieving values from my DB (SQL Server) which already contained strings with leading and trailing single quotes.

    Rick Ryan
    ------------
    Dave Classick at 3/7/01 10:24:44 PM


    Can any one tell me if when doing a Response.Write,
    do single quotation marks need quotes around them, ie

    the code:
    Response.Write &#34;<SELECT NAME=&#34;&#34;manufacturer&#34;&#34; SIZE=15>&#34;
    will print: SELECT NAME=&#34;manufacturer&#34; SIZE=15>

    but what if i wanted to print something like:

    <option value=&#34;&#39;Frame_A&#39;,&#39;location_belmont .htm&#39;&#34;>Belmont</option>

    i keep getting messed up with the single quotes

Posting Permissions

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