runat=server!

Discussion in 'ASP General' started by Arpan, Aug 25, 2005.

  1. Arpan

    Arpan Guest

    The following code snippet

    ----------------------------------------
    <script language="VBScript" runat=server>
    <%
    a=1
    %>
    </script>
    <%= a %>
    ----------------------------------------

    throws the "Expected statement" error pointing to line no. 2. Why?

    Thanks,

    Arpan
     
    Arpan, Aug 25, 2005
    #1
    1. Advertising

  2. Arpan

    Bob Lehmann Guest

    Remove the script delimiters from the <script> block.

    <script language="VBScript" runat=server>
    a=1
    </script>

    Bob Lehmann


    "Arpan" <> wrote in message
    news:...
    > The following code snippet
    >
    > ----------------------------------------
    > <script language="VBScript" runat=server>
    > <%
    > a=1
    > %>
    > </script>
    > <%= a %>
    > ----------------------------------------
    >
    > throws the "Expected statement" error pointing to line no. 2. Why?
    >
    > Thanks,
    >
    > Arpan
    >
     
    Bob Lehmann, Aug 25, 2005
    #2
    1. Advertising

  3. Because you have doubled the delimiters. Use <script></script> or <% %> ...
    there is no point in doing both.




    "Arpan" <> wrote in message
    news:...
    > The following code snippet
    >
    > ----------------------------------------
    > <script language="VBScript" runat=server>
    > <%
    > a=1
    > %>
    > </script>
    > <%= a %>
    > ----------------------------------------
    >
    > throws the "Expected statement" error pointing to line no. 2. Why?
    >
    > Thanks,
    >
    > Arpan
    >
     
    Aaron Bertrand [SQL Server MVP], Aug 25, 2005
    #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. Hazzard
    Replies:
    2
    Views:
    589
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  2. Marina
    Replies:
    0
    Views:
    566
    Marina
    Jul 21, 2003
  3. Elliot M. Rodriguez
    Replies:
    0
    Views:
    631
    Elliot M. Rodriguez
    Jul 21, 2003
  4. Natty Gur
    Replies:
    0
    Views:
    498
    Natty Gur
    Jul 22, 2003
  5. feng
    Replies:
    1
    Views:
    3,214
    Peter Rilling
    Feb 29, 2004
Loading...

Share This Page