上海有哪些古镇值得去:有关web问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 15:00:22
在web程序的page_load()事件中,如果要检验某一事情(比如连接数据库),成功就继续,不成功显示一个消息框,然后退出(不显示页面),该怎样写代码?

on error resume next

if err>0 then
response.write("<script>alert('发生错误了\n\n系统将退出');window.close();</script>")
response.end
end if

建议使用
Try{}
catch{}

同意一楼的