MS VBScript Compilation error 800a0401

Discussion in 'ASP General' started by Matthew Louden, Oct 9, 2003.

  1. I have no idea what's wrong with the following ASP statement:

    Response.Write "<select name=\"id\">"

    MS VBScript Compilation error 800a0401
    expected end of statement

    However, if I do the following, it will be fine:

    <select name="id">
    <%

    %>
    </select>


    any ideas??
    Matthew Louden, Oct 9, 2003
    #1
    1. Advertising

  2. Response.Write "<select name=""id"">"

    Within VBScript, you escape a " with another " and not \.

    --
    Manohar Kamath
    Editor, .netBooks
    www.dotnetbooks.com


    "Matthew Louden" <> wrote in message
    news:...
    > I have no idea what's wrong with the following ASP statement:
    >
    > Response.Write "<select name=\"id\">"
    >
    > MS VBScript Compilation error 800a0401
    > expected end of statement
    >
    > However, if I do the following, it will be fine:
    >
    > <select name="id">
    > <%
    >
    > %>
    > </select>
    >
    >
    > any ideas??
    >
    >
    Manohar Kamath [MVP], Oct 9, 2003
    #2
    1. Advertising

  3. Matthew Louden

    Ray at Guest

    The \ character is used to escape characters in jscript, not vbscript. In
    vbscript, you write "" to escape a " character in a string.
    Response.Write "<select name=""id"">"

    Ray at work

    "Matthew Louden" <> wrote in message
    news:...
    > I have no idea what's wrong with the following ASP statement:
    >
    > Response.Write "<select name=\"id\">"
    >
    > MS VBScript Compilation error 800a0401
    > expected end of statement
    >
    > However, if I do the following, it will be fine:
    >
    > <select name="id">
    > <%
    >
    > %>
    > </select>
    >
    >
    > any ideas??
    >
    >
    Ray at, Oct 9, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C__chp
    Replies:
    4
    Views:
    503
    Puppet_Sock
    Feb 15, 2008
  2. Adam Short
    Replies:
    3
    Views:
    600
    Ray Costanzo [MVP]
    Apr 21, 2005
  3. Adam Short
    Replies:
    6
    Views:
    222
    Adam Short
    Apr 26, 2005
  4. S N
    Replies:
    0
    Views:
    329
  5. rebecca29
    Replies:
    0
    Views:
    3,082
    rebecca29
    May 5, 2012
Loading...

Share This Page