激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - ASP教程 - javascript asp教程錯誤處理

javascript asp教程錯誤處理

2019-10-22 10:20asp技術網 ASP教程

javascript asp教程錯誤處理

The ASPError Object has zero (0) Methods, nine (9) Properties, zero (0) Events, and zero (0) Collections. 

AspCode

AspDescription

Category

Column

Description

File

Line

Number

Source


The way you access the ASPError Properties is with a Server Method. Yeah, I know; it doesn't make sense. Start with something like var myError=Server.GetLastError() and then you can access all nine ASPError Properties following this pattern: <%=myError.Line%>.

 

Below is the script for Lesson 15.

<%@LANGUAGE="JavaScript"%>
<!-- METADATA TYPE="typelib" 
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%
try
	{
	Response.Write("<STRONG>Use <I>GetLastError( )</I><BR></STRONG>\r")
	myError = Server.GetLastError()
	Response.Write("myError.Line: " + myError.Line + "<BR>\r")
	Response.Write("myError.File: " + myError.File + "\r")
	Response.Write("<HR>\r<STRONG>")
	Response.Write("Now an intentional error...")
	Response.Write("<BR></STRONG>\r")
	myError = erver.GetLastError() //this line causes an error
	Response.Write("myError.Line: " + myError.Line + "<BR>\r")
	Response.Write("myError.File: " + myError.File + "<BR>\r")
	}
catch(myDumbError) 
	{ 
	Response.Write("There is an error: " + myDumbError)
	%>
	<BR>
	Graceful error handling goes here (inside the catch statement).
	Make it as simple or sophisticated as you like.<BR>
	<HR>
	<STRONG>Now let's break down the error Object.</STRONG><BR>
	<%
	for ( var i in myDumbError)
		{
		Response.Write(i + ": " + myDumbError[i] + "<BR>\r")
		}
	}
finally
	{
	Response.Write("<HR><STRONG>Let's Finish Up.</STRONG><BR>\r")
	Response.Write("Code inside the <I>finally { }</I> statement ")
	Response.Write("executes regardless of error (or lack thereof). \r")
	Response.Write("<I>finally{ }</I> is totally optional. ")
	Response.Write("It's a good place for things like RS.Close()... ")
	Response.Write("which you'll see later on.")
	}
%>

Click Here to run the script in a new window.

Okay, so what happened to On Error Resume Next? Sorry, that ain't no JavaScript thing. So, what about onerror? That won't work on the server side. But thanks to some core JavaScript we have some error handling.

The section of script for which you wish to provide error handling goes inside the try { } statements and the what-to-do in the event of an error goes inside the catch { } statement. There is also a finally { } statement (optional). The whole thing is just as graceful as On Error (in my opinion).

Not every ASP server allows you access to the ASPError Object. So, don't be surprised if ASPError gives you an error.

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产免费人做人爱午夜视频 | 日本在线国产 | 国内精品一级毛片免费看 | 免费在线国产 | av播放在线| 天天操天天操天天操天天操天天操天天操 | 久久国语对白 | 又黄又爽又色无遮挡免费 | 亚洲一区二区三区91 | caoporn国产一区二区 | 精品久久久久久 | 国产美女自拍av | 91资源在线观看 | 羞羞的动漫在线观看 | 免费看综艺策驰影院 | 蜜桃传媒视频麻豆第一区免费观看 | 色a综合| 国产美女精品视频 | 亚洲av一级毛片特黄大片 | 一区二区三区日韩在线观看 | 国产色91 | 国产成人av免费看 | 日本娇小videos高潮 | 看国产一级毛片 | 成人h精品动漫一区二区三区 | 日本免费一区二区三区四区 | 日韩一级片一区二区三区 | 激情影院在线观看 | 99亚洲伊人久久精品影院红桃 | 黄色羞羞视频在线观看 | 亚洲精品永久视频 | 成人在线视频免费看 | 中文字幕在线播放第一页 | 在线成人www免费观看视频 | 国产成人小视频在线观看 | 久久av一区二区 | 在线成人影视 | 成人免费自拍视频 | 国产亚洲美女精品久久久2020 | 特一级黄色毛片 | 亚洲国产网站 |