vbscript syntax in asp classic

眉间皱痕 提交于 2019-12-24 00:55:35

问题


I have a vbscript that I want to run in the <head> of an asp. I am having trouble getting the script to run so I'm thinking I need some help making sure the asp knows that it's vvbscript or something. The last script is the one I am having trouble running.

here is what I have:

<%@ Language=VBScript %>
<%

    ***vbscript***

%>
<HTML>
<HEAD>
<link rel="stylesheet" href="MD_intstyle.css" type="text/css">
<SCRIPT Language="JavaScript">

     ***javascript***

</script>

<script language="vbscript">
     ***vbscript I am trying to run***
</script>

</HEAD>

回答1:


Change:

 <script language="vbscript">
 ***vbscript I am trying to run***
 </script>

To:

<%
***vbscript I am trying to run***
%>

AS(erver)P runs on the server and therefore you cant tell the client to run the code as vbscript with HTML-tags. Start your ASP code with the start tag <% and the close tag %>. Just as you do on the top in your example.




回答2:


use runat="server" in script tag.

 <script language="vbscript" runat="server">
      ***vbscript I am trying to run***
 </script>


来源:https://stackoverflow.com/questions/6611493/vbscript-syntax-in-asp-classic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!