For Programmers: Free Programming Magazines  


Home > Archive > ASP > August 2005 > runat=server!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author runat=server!
Arpan

2005-08-25, 7:56 am

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

2005-08-25, 7:56 am

Remove the script delimiters from the <script> block.

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

Bob Lehmann


"Arpan" <arpan_de@hotmail.com> wrote in message
news:1124972668.206805.86190@g49g2000cwa.googlegroups.com...
> 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]

2005-08-25, 6:55 pm

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




"Arpan" <arpan_de@hotmail.com> wrote in message
news:1124972668.206805.86190@g49g2000cwa.googlegroups.com...
> 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
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com