注册 登录
编程论坛 ASP技术论坛

msgbox 无权限

peswe 发布于 2008-04-10 22:15, 1156 次点击
刚学asp,好多郁闷的东西哦!~
为什么msgbox 在<% %>中就没权限?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%

msgbox "hello world!~"

%>
</body>
</html>
9 回复
#2
makebest2008-04-10 23:24
<%%> 中的代码是设计在服务器上运行的,属于后台程序,是没有界面和无人值守的,如果弹出了窗口没有人点确定,服务器不是挂了吗?
#3
zmhdxy2008-04-10 23:35
<%%>要有iis才可以运行
不过直接用vbscript脚本 也可以象js一样 用于前台,这样msgbox就可以用了
#4
madpbpl2008-04-11 02:06
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<script language="vbscript">

msgbox "hello world!~"

</script>
</body>
</html>
#5
peswe2008-04-11 13:18
谢谢,学习了!~
#6
peswe2008-04-11 13:37
这样怎么也不可以呢,说是有语法错误!~
<body>
<table>
<%
response.write "<script language='vbscript'> msgbox('hello,world!~') </script>"
%>
</table>
</body>
</html>
#7
yms1232008-04-11 17:12
<body>
<table>
<%
response.write "<script language='vbscript'> msgbox('hello,world!~') </script>"
%>
</table>
</body>
</html>
VBScript中好像'单引号代表不了字符串,可以使用javascript同样函数来实现
<body>
<table>
<%
response.write "<script language='javascript'> alert('hello,world!~'); </script>"
%>
</table>
</body>
</html>
#8
tianyu1232008-04-11 17:44
MsgBox 是客户端函数,不能在服务端调用

InputBox 也是客户端函数
#9
peswe2008-04-11 18:58
谢谢各位的指点,原来换成javascript就可以了!~·
#10
china25qd2008-04-11 20:46
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<% response.write "<script language='vbscript'>

msgbox "hello world!" %>
</body>
</html>
1