<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>守望轩 &#187; 跟踪</title>
	<atom:link href="http://www.watch-life.net/tag/%e8%b7%9f%e8%b8%aa/feed" rel="self" type="application/rss+xml" />
	<link>http://www.watch-life.net</link>
	<description>关注IT,审视自我,守望生活, 宁静雅致的小轩馆.</description>
	<lastBuildDate>Tue, 20 Jul 2010 00:46:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>web developer tips (77):在ASP.NET启动启动页面级跟踪</title>
		<link>http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html</link>
		<comments>http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html#comments</comments>
		<pubDate>Tue, 23 Mar 2010 14:47:47 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[tracing]]></category>
		<category><![CDATA[web developer tips]]></category>
		<category><![CDATA[跟踪]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=506</guid>
		<description><![CDATA[原文地址： How to enable Page Level Tracing for your ASP.NET pages
在调试Asp.net的web应用的时候，启动页面级跟踪，将会给一大串的有用信息。这些跟踪信息可以帮助我们理解控件在各种视图状态下的运行情况，比如PreInit（事件）的开始和结束时，Init事件的开始和结束状态，Render事件的开始和结束状态 等等。这些信息会出现在页面的底部。默认情况下页面级跟踪是不开启的。
http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html
跟踪可以页面级和应用级启动。
开启的方法： Visual Studio 2008在属性窗口选择“ DOCUMENT ”，设置“ Trace  ”属性为“true”，如下所示：

这种设置将在指定的页面上添加Trace=&#34;true&#34;，如下所示：
&#60;%@ Page Language=&#34;VB&#34;&#160; Trace=&#34;true&#34; %&#62;
同时，如果想显示的跟踪按时间排序（SortedByTime）或 按类别排序（SortByCategory），也可以设置TraceMode 属性。
运行页面后，效果详情如下所示：

可以通过Asp.net应用根目录的web.config文件来启动应用级跟踪，这样启动后你可以获取整个应用所有页面的跟踪信息。在这种情况下，如果你不想跟踪某个特定的页面，应该设置页面级跟踪为不启用。
应用级跟踪的设置方法，在web.cofig中设置如下：

&#60;configuration&#62; &#60;system.web&#62; 
&#60;trace enabled=&#34;true&#34; requestLimit=&#34;40&#34; localOnly=&#34;false&#34;/&#62; 
&#60;/system.web&#62;&#60;/configuration&#62;

记住在应用发布的时候，要关闭跟踪。同时，页面级跟踪会覆盖应用级跟踪。


	你可能也会喜欢以下文章：
	
	web developer tips (48):IIS7应用程序池的“Ping”设置可能影响调试 (0)
	web developer tips (53):在vs的设计视图编辑gridview的模板 (0)
	&#8220;Visual Studio 2008&#8243;背后的勃勃野心 (0)
	web developer tips (69):vs中在浏览器中查看的快捷键 (2)
	web developer tips (57):通过web界面管理web站点配置 (1)
	在GRIDVIEW中合并单元格 (0)
	web developer tips (40):定义母版页的作用范围 [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址： <a href="http://blogs.msdn.com/webdevelopertips/archive/2009/06/11/tip-77-did-you-know-how-to-enable-page-level-tracing-for-your-asp-net-pages.aspx" target="_blank">How to enable Page Level Tracing for your ASP.NET pages</a></p>
<p>在调试<a href="http://www.watch-life.net/category/aspnet" target="_blank">Asp.net</a>的web应用的时候，启动页面级跟踪，将会给一大串的有用信息。这些跟踪信息可以帮助我们理解控件在各种视图状态下的运行情况，比如PreInit（事件）的开始和结束时，Init事件的开始和结束状态，Render事件的开始和结束状态 等等。这些信息会出现在页面的底部。默认情况下页面级跟踪是不开启的。</p>
<p><a href="http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html" target="_blank">http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html</a></p>
<p>跟踪可以页面级和应用级启动。</p>
<p>开启的方法： Visual Studio 2008在属性窗口选择“ <strong>DOCUMENT</strong> ”，设置“ <strong>Trace</strong>  ”属性为“<font color="red">true</font>”，如下所示：</p>
<p><img title="Enable trace for a page." height="436" alt="Enable trace for a page." src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip77DidyouknowHowtoenablePageLe.NETpage_C29D/Enable%20trace%20for%20a%20page._thumb.jpg" width="229" mce_src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip77DidyouknowHowtoenablePageLe.NETpage_C29D/Enable%20trace%20for%20a%20page._thumb.jpg" /></p>
<p>这种设置将在指定的页面上添加<strong>Trace=&quot;true&quot;</strong>，如下所示：</p>
<div class=code>&lt;%@ Page Language=&quot;VB&quot;&#160; Trace=&quot;true&quot; %&gt;</div>
<p>同时，如果想显示的跟踪按时间排序（SortedByTime）或 按类别排序（SortByCategory），也可以设置<strong>TraceMode </strong>属性。</p>
<p>运行页面后，效果详情如下所示：<br />
<img title="Tracing Enabled" height="328" alt="Tracing Enabled" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip77DidyouknowHowtoenablePageLe.NETpage_C29D/Tracing%20Enabled_thumb.jpg" width="507" mce_src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip77DidyouknowHowtoenablePageLe.NETpage_C29D/Tracing%20Enabled_thumb.jpg" /></p>
<p>可以通过Asp.net应用根目录的web.config文件来启动应用级跟踪，这样启动后你可以获取整个应用所有页面的跟踪信息。在这种情况下，如果你不想跟踪某个特定的页面，应该设置<a href="http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html" target="_blank">页面级跟踪</a>为不启用。</p>
<p>应用级跟踪的设置方法，在web.cofig中设置如下：</p>
<div class=code>
<p>&lt;configuration&gt; &lt;system.web&gt; </p>
<p>&lt;<strong>trace enabled=&quot;true&quot;</strong> requestLimit=&quot;40&quot; localOnly=&quot;false&quot;/&gt; </p>
<p>&lt;/system.web&gt;&lt;/configuration&gt;</p>
</div>
<p>记住在应用发布的时候，要关闭跟踪。同时，页面级跟踪会覆盖应用级跟踪。</p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/iis7-application-pool-s-ping-settings-may-affect-debugging.html" title="web developer tips (48):IIS7应用程序池的“Ping”设置可能影响调试 (2009-09-16)">web developer tips (48):IIS7应用程序池的“Ping”设置可能影响调试</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html" title="web developer tips (53):在vs的设计视图编辑gridview的模板 (2009-10-12)">web developer tips (53):在vs的设计视图编辑gridview的模板</a> (0)</li>
	<li><a href="http://www.watch-life.net/it-review/visual-studio-2008-ambition.html" title="&#8220;Visual Studio 2008&#8243;背后的勃勃野心 (2008-02-10)">&#8220;Visual Studio 2008&#8243;背后的勃勃野心</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/the-keyboard-shortcut-for-view-in-browser.html" title="web developer tips (69):vs中在浏览器中查看的快捷键 (2009-11-27)">web developer tips (69):vs中在浏览器中查看的快捷键</a> (2)</li>
	<li><a href="http://www.watch-life.net/visual-studio/manage-web-site-configuration-through-a-web-interface.html" title="web developer tips (57):通过web界面管理web站点配置 (2009-10-30)">web developer tips (57):通过web界面管理web站点配置</a> (1)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-merger-cell.html" title="在GRIDVIEW中合并单元格 (2007-12-18)">在GRIDVIEW中合并单元格</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/know-how-to-scope-master-pages.html" title="web developer tips (40):定义母版页的作用范围 (2009-08-31)">web developer tips (40):定义母版页的作用范围</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/change-wap-to-use-an-iis-web-server.html" title="web developer tips (20):使用IIS作为web服务器 (2009-07-12)">web developer tips (20):使用IIS作为web服务器</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web developer tips (15):在ASP.NET Ajax里使用跟踪</title>
		<link>http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html</link>
		<comments>http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html#comments</comments>
		<pubDate>Thu, 02 Jul 2009 13:03:23 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Sys.Debug.trace]]></category>
		<category><![CDATA[web developer tip]]></category>
		<category><![CDATA[调试]]></category>
		<category><![CDATA[跟踪]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=397</guid>
		<description><![CDATA[原文地址： How to use tracing with ASP.NET Ajax
如果你在使用ASP.NET Ajax的时候，遇到一个页面问题，想在调试时候跟踪语句，有个比较快速的方法：使用“Sys.Debug.trace”函数。
&#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62;
function PositionDiv() {
Sys.Debug.trace(&#34;Entering PositionDiv Function&#34;);
//some other code
Sys.Debug.trace(&#34;Exiting PositionDiv Function&#34;);
}
&#60;/script&#62;
 http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html
为了看到跟踪输出的内容，在页面上加一个TextArea的控件，控件的ID为“TraceConsole”。这个现实的跟踪的可用性，一旦应用，将意味着将该TextArea必须手动添加到输出。不过，在调试网站的时候，跟踪的内容也被写到Visual Studio的输出窗口，就像FireFox的输出控制台一样。
Sys.Debug 类还有其他许多好的方法，例如:
assert:如果被测试的条件是false的，将会有个消息框来显示消息。
fail：引发程序终止或中断调试。
traceDump：用清晰的格式显示对象数据。
延伸阅读：
1、有关Sys.Debug 参见：http://msdn.microsoft.com/zh-cn/library/bb397422.aspx
2、Debugging and Tracing AJAx Applications

　
下面是在不同的方式来debug AJAX-enabled ASP.NET application

(1)在Configuration文件中授权.
(2)在服务端使用tracing
(3)使用在Sys.Debug类的方法设置breakpoints和handle trace输出
(4)在浏览器材里面授权debugging
(5)追加Visual Studio2008 debugger或在你的浏览器里面扩展工具.
(7)使用扩展工具捕获HTTP的交换.

　
(1)在Configuration文件中授权.


在Configuration中添加一个compilation元素,设置一贯debug属性为&#34;true&#34;,如下面:

　

	&#60;configuration&#62;
	&#160;&#160;&#60;system.web&#62;
	&#160;&#160;&#160;&#160;&#60;compilation&#160;debug=&#34;true&#34;&#62;
	&#160;&#160;&#160;&#160;&#160;&#160;&#60;!&#8211;&#160;etc.&#160;&#8211;&#62;
	&#160;&#160;&#160;&#160;&#60;/compilation&#62;
	&#160;&#160;&#60;/system.web&#62;
	&#60;configuration&#62;


要将应用程序发布,就要从debug该为Release才能发布

在Web.config文件中,如果compilation元素中包括debug,就将里面debug属性该为&#34;false&#34;

确定在ScriptManager中面的ScriptMode属性设置为Release

而在@page中指定的debug属性不会影响ASP.NET AJAX applications.而为ScriptManager在Web.config中设置的IsDebuggingEnabled
and ScriptMode属性是决定是否呈现debug脚本.

　
(2)Tracing on the Server


怎样授权ASP.NET页面Tracing就是这样
&#60;%@ Page Trace=&#34;true&#34; %&#62;

而在ASP.NET
AJAX中就必须有一个partial-page呈现授权,也就是要在ScriptManager中将EnablePartialRendering属性设置为&#34;true&#34;,
其实就是所说的饿&#34;view debugger trace messages in the Output window&#34;.&#160;
　
(3)Debug Helper Class

ASP.NET为调试客户端应用程序提供一个Sys.Debug Class.如果你是IE你可以在你的也面上创建一个


就是使用下面的方法:

Sys.Debug.assert(condition,message,displayCaller)
给出检测条件,并如果条件为false时候,就会有在debugger中提示.

Sys.Debug.clearTrace()
清楚所有的指定在id为&#34;TraceConsole&#34;元素中显示的信息.

Sys.Debug.traceDump(object,name)

抑制一个对象在debugger console和TraceConsole中输出.

Sys.Debug.fail(message)
显示一个message在debugger的输出窗口和TraceConsole的textarea元素中

Sys.Debug.trace(text)
在debugger console和TraceConsole中追加一行文本.
这个是MSDN上的事例
　

	&#60;!DOCTYPE&#160;html&#160;PUBLIC&#160;&#34;-//W3C//DTD&#160;XHTML&#160;1.1//EN&#34;&#160;&#34;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34;&#62;
	&#60;html&#160;&#62;
	&#60;head&#160;id=&#34;Head1&#34;&#160;runat=&#34;server&#34;&#62;
	&#160;&#160;&#160;&#160;&#60;title&#62;Untitled&#160;Page&#60;/title&#62;
	&#60;script&#160;language=&#34;javascript&#34;&#160;type=&#34;text/javascript&#34;&#62;
	function&#160;btnAssert_onclick()&#160;{
	&#160;&#160;&#160;&#160;var&#160;n;
	&#160;&#160;&#160;&#160;//&#160;Insert&#160;code&#160;intended&#160;to&#160;set&#160;n&#160;to&#160;a&#160;positive&#160;integer.
	&#160;&#160;&#160;&#160;if&#160;(false)&#160;n&#160;=&#160;3;
	&#160;&#160;&#160;&#160;//&#160;Assert&#160;if&#160;n&#160;is&#160;not&#160;greater&#160;than&#160;0.
	&#160;&#160;&#160;&#160;Sys.Debug.assert(n&#160;&#62;&#160;0,&#160;&#34;n&#160;must&#160;be&#160;set&#160;to&#160;a&#160;positive&#160;integer.&#34;);
	}
	
	function&#160;btnFail_onclick()&#160;{
	&#160;&#160;&#160;&#160;var&#160;n;
	&#160;&#160;&#160;&#160;//&#160;Insert&#160;code&#160;intended&#160;to&#160;set&#160;n&#160;to&#160;a&#160;numeric&#160;value.
	&#160;&#160;&#160;&#160;if&#160;(false)&#160;n&#160;=&#160;3;
	&#160;&#160;&#160;&#160;//&#160;Fail&#160;if&#160;n&#160;is&#160;not&#160;numeric.
	&#160;&#160;&#160;&#160;if&#160;(isNaN(n))&#160;Sys.Debug.fail(&#34;The&#160;value&#160;of&#160;n&#160;must&#160;be&#160;a&#160;number.&#34;);
	}
	
	function&#160;btnTrace_onclick()&#160;{
	&#160;&#160;&#160;&#160;v&#160;=&#160;form1.text1.value;
	&#160;&#160;&#160;&#160;Sys.Debug.trace(&#34;Name&#160;set&#160;to&#160;&#34;&#160;+&#160;&#34;\&#34;&#34;&#160;+&#160;v&#160;+&#160;&#34;\&#34;.&#34;);
	&#160;&#160;&#160;&#160;alert(&#34;Hello&#160;&#34;&#160;+&#160;v&#160;+&#160;&#34;.&#34;);
	}
	
	function&#160;btnDump_onclick()&#160;{
	&#160;&#160;&#160;&#160;Sys.Debug.traceDump(form1.text1,&#160;&#34;Name&#160;textbox&#34;);
	&#160;&#160;&#160;&#160;alert(&#34;Hello&#160;&#34;&#160;+&#160;form1.text1.value&#160;+&#160;&#34;.&#34;);
	}
	
	function&#160;btnClear_onclick()&#160;{
	&#160;&#160;&#160;&#160;Sys.Debug.clearTrace()
	&#160;&#160;&#160;&#160;alert(&#34;Trace&#160;console&#160;cleared.&#34;);
	}
	&#60;/script&#62;
	&#60;/head&#62;
	&#60;body&#62;
	&#60;form&#160;id=&#34;form1&#34;&#160;runat=&#34;server&#34;&#62;
	&#160;&#160;&#160;&#160;&#60;h2&#62;Sys.Debug&#160;Methods&#160;Test&#160;Page&#60;/h2&#62;
	&#160;&#160;&#160;&#160;&#60;asp:ScriptManager&#160;ID=&#34;ScriptManager1&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;runat=&#34;server&#34;&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;p&#62;&#60;b&#62;Use&#160;these&#160;buttons&#160;to&#160;demonstrate&#160;the&#160;assert()&#160;and&#160;fail()&#160;
	&#160;&#160;&#160;&#160;methods:&#60;/b&#62;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;btnAssert&#34;&#160;type=&#34;button&#34;&#160;value=&#34;Assert&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;style=&#34;width:&#160;100px&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onclick=&#34;return&#160;btnAssert_onclick()&#34;&#160;/&#62;&#160;&#38;nbsp
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;btnFail&#34;&#160;type=&#34;button&#34;&#160;value=&#34;Fail&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;style=&#34;width:&#160;100px&#34;&#160;onclick=&#34;return&#160;btnFail_onclick()&#34;&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;/p&#62;&#60;hr&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;b&#62;Use&#160;the&#160;textbox&#160;and&#160;buttons&#160;below&#160;to&#160;demonstrate&#160;tracing.&#60;/b&#62;
	&#160;&#160;&#160;&#160;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;p&#62;Enter&#160;your&#160;name&#160;here:&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;text1&#34;&#160;maxlength=&#34;50&#34;&#160;type=&#34;text&#34;&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;btnTrace&#34;&#160;type=&#34;button&#34;&#160;value=&#34;Trace&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;style=&#34;width:&#160;100px&#34;&#160;onclick=&#34;return&#160;btnTrace_onclick()&#34;&#160;/&#62;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;btnDump&#34;&#160;type=&#34;button&#34;&#160;value=&#34;TraceDump&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;style=&#34;width:&#160;100px&#34;&#160;onclick=&#34;return&#160;btnDump_onclick()&#34;&#160;/&#62;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;input&#160;id=&#34;btnClear&#34;&#160;type=&#34;button&#34;&#160;value=&#34;ClearTrace&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;style=&#34;width:&#160;100px&#34;&#160;onclick=&#34;return&#160;btnClear_onclick()&#34;&#160;/&#62;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;br&#160;/&#62;&#60;/p&#62;
	&#160;&#160;&#160;&#160;View&#160;output&#160;in&#160;the&#160;TraceConsole&#160;textarea&#160;below.
	&#160;&#160;&#160;&#160;&#60;br&#160;/&#62;
	&#160;&#160;&#160;&#160;&#60;textarea&#160;id=&#8217;TraceConsole&#8217;&#160;rows=&#34;10&#34;&#160;cols=&#34;50&#34;&#160;
	&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;title=&#34;TraceConsole&#34;&#62;&#60;/textarea&#62;
	&#60;/form&#62;
	&#60;/body&#62;
	&#60;/html&#62;
	

　
(4)To enable [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://blogs.msdn.com/webdevelopertips/archive/2008/10/19/tip-15-did-you-know-how-to-use-tracing-with-asp-net-ajax.aspx" target="_blank"> How to use tracing with ASP.NET Ajax</a></p>
<p>如果你在使用ASP.NET Ajax的时候，遇到一个页面问题，想在调试时候跟踪语句，有个比较快速的方法：使用“<strong>Sys.Debug.trace</strong>”函数。</p>
<blockquote><p>&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;</p>
<p>function PositionDiv() {<br />
Sys.Debug.trace(&quot;Entering PositionDiv Function&quot;);<br />
//some other code<br />
Sys.Debug.trace(&quot;Exiting PositionDiv Function&quot;);<br />
}<br />
&lt;/script&gt;</p></blockquote>
<p> <a href="http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html" target="_blank">http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html</a></p>
<p>为了看到<a href="http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html" target="_blank">跟踪输出的内容</a>，在页面上加一个TextArea的控件，控件的ID为“TraceConsole”。这个现实的跟踪的可用性，一旦应用，将意味着将该TextArea必须手动添加到输出。不过，在调试网站的时候，跟踪的内容也被写到Visual Studio的输出窗口，就像FireFox的输出控制台一样。</p>
<p>Sys.Debug 类还有其他许多好的方法，例如:<br />
<strong>assert</strong>:如果被测试的条件是false的，将会有个消息框来显示消息。<br />
<strong>fail</strong>：引发程序终止或中断调试。<br />
<strong>traceDump</strong>：用清晰的格式显示对象数据。</p>
<p>延伸阅读：<br />
1、有关Sys.Debug 参见：http://msdn.microsoft.com/zh-cn/library/bb397422.aspx</p>
<p>2、<a href="http://www.cnblogs.com/worksguo/articles/1097453.html" target="_blank">Debugging and Tracing AJAx Applications</a></p>
<blockquote>
<h2 style="padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 20px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">　</h2>
<p>下面是在不同的方式来debug AJAX-enabled ASP.NET application<br style="clear: both; "><br />
<br style="clear: both; "><br />
(1)在Configuration文件中授权.<br style="clear: both; "><br />
(2)在服务端使用tracing<br style="clear: both; "><br />
(3)使用在Sys.Debug类的方法设置breakpoints和handle trace输出<br style="clear: both; "><br />
(4)在浏览器材里面授权debugging<br style="clear: both; "><br />
(5)追加Visual Studio2008 debugger或在你的浏览器里面扩展工具.<br style="clear: both; "><br />
(7)使用扩展工具捕获HTTP的交换.<br style="clear: both; "><br />
<br style="clear: both; "><br />
　<br />
<hr />(1)在Configuration文件中授权.<br />
<hr /><br style="clear: both; "><br />
<br style="clear: both; "><br />
在Configuration中添加一个compilation元素,设置一贯debug属性为&quot;true&quot;,如下面:<br style="clear: both; "><br />
<br style="clear: both; "><br />
　
<div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 646px; ">
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top"><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">configuration</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top">&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">system.web</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">compilation&nbsp;</span><span style="color: rgb(255, 0, 0); ">debug</span><span style="color: rgb(0, 0, 255); ">=&quot;true&quot;&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0); ">&lt;!&#8211;&nbsp;etc.&nbsp;&#8211;&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">compilation</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top">&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">system.web</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" align="top"></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">configuration</span><span style="color: rgb(0, 0, 255); ">&gt;</span></div>
<p><br style="clear: both; "><br />
<br style="clear: both; "><br />
要将应用程序发布,就要从debug该为Release才能发布<br style="clear: both; "><br />
<br style="clear: both; "><br />
在Web.config文件中,如果compilation元素中包括debug,就将里面debug属性该为&quot;false&quot;<br style="clear: both; "><br />
<br style="clear: both; "><br />
确定在ScriptManager中面的ScriptMode属性设置为Release<br style="clear: both; "><br />
<br style="clear: both; "><br />
而在@page中指定的debug属性不会影响ASP.NET AJAX applications.而为ScriptManager在Web.config中设置的IsDebuggingEnabled<br />
and ScriptMode属性是决定是否呈现debug脚本.<br style="clear: both; "><br />
<br style="clear: both; "><br />
　<br />
<hr />(2)Tracing on the Server<br />
<hr /><br style="clear: both; "><br />
<br style="clear: both; "><br />
怎样授权ASP.NET页面Tracing就是这样<br style="clear: both; "><br />
&lt;%@ Page Trace=&quot;true&quot; %&gt;<br style="clear: both; "><br />
<br style="clear: both; "><br />
而在ASP.NET<br />
AJAX中就必须有一个partial-page呈现授权,也就是要在ScriptManager中将EnablePartialRendering属性设置为&quot;true&quot;,<br style="clear: both; "><br />
其实就是所说的饿&quot;view debugger trace messages in the Output window&quot;.<span class="Apple-converted-space">&nbsp;</span><br style="clear: both; "><br />
　<br />
<hr />(3)Debug Helper Class<br />
<hr /><br style="clear: both; "><br />
ASP.NET为调试客户端应用程序提供一个Sys.Debug Class.如果你是IE你可以在你的也面上创建一个<br style="clear: both; "><br />
<br style="clear: both; "><br />
<br style="clear: both; "><br />
就是使用下面的方法:<br style="clear: both; "><br />
<br style="clear: both; "><br />
Sys.Debug.assert(condition,message,displayCaller)<br style="clear: both; "><br />
给出检测条件,并如果条件为false时候,就会有在debugger中提示.<br style="clear: both; "><br />
<br style="clear: both; "><br />
Sys.Debug.clearTrace()<br style="clear: both; "><br />
清楚所有的指定在id为&quot;TraceConsole&quot;元素中显示的信息.<br style="clear: both; "><br />
<br style="clear: both; "><br />
Sys.Debug.traceDump(object,name)<br style="clear: both; "><br />
<br style="clear: both; "><br />
抑制一个对象在debugger console和TraceConsole中输出.<br style="clear: both; "><br />
<br style="clear: both; "><br />
Sys.Debug.fail(message)<br style="clear: both; "><br />
显示一个message在debugger的输出窗口和TraceConsole的textarea元素中<br style="clear: both; "><br />
<br style="clear: both; "><br />
Sys.Debug.trace(text)<br style="clear: both; "><br />
在debugger console和TraceConsole中追加一行文本.<br style="clear: both; "><br />
这个是MSDN上的事例<br style="clear: both; "><br />
　
<div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 646px; ">
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""><span style="color: rgb(0, 0, 255); ">&lt;!</span><span style="color: rgb(255, 0, 255); ">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.1//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">html&nbsp;</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">head&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;Head1&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;runat</span><span style="color: rgb(0, 0, 255); ">=&quot;server&quot;&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">title</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); ">Untitled&nbsp;Page</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">title</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img id="Codehighlighter1_225_1067_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_225_1067_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_225_1067_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_225_1067_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">script&nbsp;</span><span style="color: rgb(255, 0, 0); ">language</span><span style="color: rgb(0, 0, 255); ">=&quot;javascript&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;text/javascript&quot;&gt;</span><span id="Codehighlighter1_225_1067_Open_Text"><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img id="Codehighlighter1_255_462_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_255_462_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_255_462_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_255_462_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;btnAssert_onclick()&nbsp;</span><span id="Codehighlighter1_255_462_Open_Text"><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">{<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">var</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;n;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0); ">//&nbsp;Insert&nbsp;code&nbsp;intended&nbsp;to&nbsp;set&nbsp;n&nbsp;to&nbsp;a&nbsp;positive&nbsp;integer.<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">false</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">)&nbsp;n&nbsp;=&nbsp;3;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0); ">//&nbsp;Assert&nbsp;if&nbsp;n&nbsp;is&nbsp;not&nbsp;greater&nbsp;than&nbsp;0.<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;&nbsp;&nbsp;&nbsp;Sys.Debug.assert(n&nbsp;&gt;&nbsp;0,&nbsp;&quot;n&nbsp;must&nbsp;be&nbsp;set&nbsp;to&nbsp;a&nbsp;positive&nbsp;integer.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="">}</span></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""><br style="clear: both; "><br />
	<img id="Codehighlighter1_491_687_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_491_687_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_491_687_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_491_687_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;btnFail_onclick()&nbsp;</span><span id="Codehighlighter1_491_687_Open_Text"><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">{<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">var</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;n;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0); ">//&nbsp;Insert&nbsp;code&nbsp;intended&nbsp;to&nbsp;set&nbsp;n&nbsp;to&nbsp;a&nbsp;numeric&nbsp;value.<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">false</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">)&nbsp;n&nbsp;=&nbsp;3;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0); ">//&nbsp;Fail&nbsp;if&nbsp;n&nbsp;is&nbsp;not&nbsp;numeric.<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;(isNaN(n))&nbsp;Sys.Debug.fail(&quot;The&nbsp;value&nbsp;of&nbsp;n&nbsp;must&nbsp;be&nbsp;a&nbsp;number.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="">}</span></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""><br style="clear: both; "><br />
	<img id="Codehighlighter1_717_836_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_717_836_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_717_836_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_717_836_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;btnTrace_onclick()&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); " id="Codehighlighter1_717_836_Open_Text">{<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;v&nbsp;=&nbsp;form1.text1.value;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;Sys.Debug.trace(&quot;Name&nbsp;set&nbsp;to&nbsp;&quot;&nbsp;+&nbsp;&quot;\&quot;&quot;&nbsp;+&nbsp;v&nbsp;+&nbsp;&quot;\&quot;.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Hello&nbsp;&quot;&nbsp;+&nbsp;v&nbsp;+&nbsp;&quot;.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""><br style="clear: both; "><br />
	<img id="Codehighlighter1_865_969_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_865_969_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_865_969_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_865_969_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;btnDump_onclick()&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); " id="Codehighlighter1_865_969_Open_Text">{<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;Sys.Debug.traceDump(form1.text1,&nbsp;&quot;Name&nbsp;textbox&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Hello&nbsp;&quot;&nbsp;+&nbsp;form1.text1.value&nbsp;+&nbsp;&quot;.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt=""><br style="clear: both; "><br />
	<img id="Codehighlighter1_999_1066_Open_Image" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_999_1066_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_999_1066_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_999_1066_Closed_Text').style.display='inline';" align="top" alt=""></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255); ">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); ">&nbsp;btnClear_onclick()&nbsp;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); " id="Codehighlighter1_999_1066_Open_Text">{<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;Sys.Debug.clearTrace()<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Trace&nbsp;console&nbsp;cleared.&quot;);<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span></span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">script</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">head</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">body</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">form&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;form1&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;runat</span><span style="color: rgb(0, 0, 255); ">=&quot;server&quot;&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">h2</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); ">Sys.Debug&nbsp;Methods&nbsp;Test&nbsp;Page</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">h2</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">asp:ScriptManager&nbsp;</span><span style="color: rgb(255, 0, 0); ">ID</span><span style="color: rgb(0, 0, 255); ">=&quot;ScriptManager1&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;runat</span><span style="color: rgb(0, 0, 255); ">=&quot;server&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">p</span><span style="color: rgb(0, 0, 255); ">&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">b</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); ">Use&nbsp;these&nbsp;buttons&nbsp;to&nbsp;demonstrate&nbsp;the&nbsp;assert()&nbsp;and&nbsp;fail()&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;methods:</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">b</span><span style="color: rgb(0, 0, 255); ">&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;btnAssert&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;button&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;value</span><span style="color: rgb(0, 0, 255); ">=&quot;Assert&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style</span><span style="color: rgb(0, 0, 255); ">=&quot;width:&nbsp;100px&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onclick</span><span style="color: rgb(0, 0, 255); ">=&quot;return&nbsp;btnAssert_onclick()&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span><span style="color: rgb(255, 0, 0); ">&amp;nbsp</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;btnFail&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;button&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;value</span><span style="color: rgb(0, 0, 255); ">=&quot;Fail&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style</span><span style="color: rgb(0, 0, 255); ">=&quot;width:&nbsp;100px&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;onclick</span><span style="color: rgb(0, 0, 255); ">=&quot;return&nbsp;btnFail_onclick()&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">p</span><span style="color: rgb(0, 0, 255); ">&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">hr&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">b</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); ">Use&nbsp;the&nbsp;textbox&nbsp;and&nbsp;buttons&nbsp;below&nbsp;to&nbsp;demonstrate&nbsp;tracing.</span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">b</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">p</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); ">Enter&nbsp;your&nbsp;name&nbsp;here:</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;text1&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;maxlength</span><span style="color: rgb(0, 0, 255); ">=&quot;50&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;text&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;btnTrace&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;button&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;value</span><span style="color: rgb(0, 0, 255); ">=&quot;Trace&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style</span><span style="color: rgb(0, 0, 255); ">=&quot;width:&nbsp;100px&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;onclick</span><span style="color: rgb(0, 0, 255); ">=&quot;return&nbsp;btnTrace_onclick()&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;btnDump&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;button&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;value</span><span style="color: rgb(0, 0, 255); ">=&quot;TraceDump&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style</span><span style="color: rgb(0, 0, 255); ">=&quot;width:&nbsp;100px&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;onclick</span><span style="color: rgb(0, 0, 255); ">=&quot;return&nbsp;btnDump_onclick()&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">input&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&quot;btnClear&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;type</span><span style="color: rgb(0, 0, 255); ">=&quot;button&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;value</span><span style="color: rgb(0, 0, 255); ">=&quot;ClearTrace&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;style</span><span style="color: rgb(0, 0, 255); ">=&quot;width:&nbsp;100px&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;onclick</span><span style="color: rgb(0, 0, 255); ">=&quot;return&nbsp;btnClear_onclick()&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;&lt;/</span><span style="color: rgb(128, 0, 0); ">p</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;View&nbsp;output&nbsp;in&nbsp;the&nbsp;TraceConsole&nbsp;textarea&nbsp;below.<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">br&nbsp;</span><span style="color: rgb(0, 0, 255); ">/&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255); ">&lt;</span><span style="color: rgb(128, 0, 0); ">textarea&nbsp;</span><span style="color: rgb(255, 0, 0); ">id</span><span style="color: rgb(0, 0, 255); ">=&#8217;TraceConsole&#8217;&nbsp;</span><span style="color: rgb(255, 0, 0); ">rows</span><span style="color: rgb(0, 0, 255); ">=&quot;10&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;cols</span><span style="color: rgb(0, 0, 255); ">=&quot;50&quot;</span><span style="color: rgb(255, 0, 0); ">&nbsp;<br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title</span><span style="color: rgb(0, 0, 255); ">=&quot;TraceConsole&quot;&gt;&lt;/</span><span style="color: rgb(128, 0, 0); ">textarea</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">form</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">body</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span><span style="color: rgb(0, 0, 255); ">&lt;/</span><span style="color: rgb(128, 0, 0); ">html</span><span style="color: rgb(0, 0, 255); ">&gt;</span><span style="color: rgb(0, 0, 0); "><br style="clear: both; "><br />
	<img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt=""></span></div>
<p><br style="clear: both; "><br />
　<br />
<hr />(4)To enable debugging in Internet Explorer<br />
<hr /><br style="clear: both; "><br />
就是在IE里面设置Disable Script Debugging.<br style="clear: both; "><br />
Disable Script Debugging (Other)<br style="clear: both; "><br />
Display a notification about every script error<br style="clear: both; "><br />
Show friendly HTTP error messages<span class="Apple-converted-space">&nbsp;</span><br style="clear: both; "><br />
都打开就能调试js.<br style="clear: both; "><br />
<br style="clear: both; "><br />
当然还可以使用我们熟悉的那IE的扩展工具.<br style="clear: both; "><br />
<br style="clear: both; "><br />
Attaching the Visual Studio Debugger to Internet Explorer<br style="clear: both; "><br />
<br style="clear: both; "><br />
你要debug客户端的脚本,你必须追加debugger到IE里面.<br style="clear: both; "><br />
<br style="clear: both; "><br />
在Visual Studio debugger中选中Debug menu,选中Attach to Process,只后会有一个Attach to<br />
Process对话框.选种iexplore.exe.<br style="clear: both; "><br />
<br style="clear: both; "><br />
这样就可以拉.如果你使用IE遭遇脚本错误,并且你按这样的设定,但不在当前就追加到debugger中,浏览器会提示你选择一个debugger.你既能继续不debugging或追加一个debugger直接通过代码.</span></span></p>
</blockquote>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/have-c-and-vb-net-files-inside-your-app-code-directory.html" title="web developer tips (26):在 App_Code目录下同时放c#和VB.NET文件 (2009-07-19)">web developer tips (26):在 App_Code目录下同时放c#和VB.NET文件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/migrating-vs-2005-web-application-project-to-vs-2008.html" title="web developer tips (82):Visual Studio 2005web应用项目迁移到Visual Studio 2008 (2010-03-29)">web developer tips (82):Visual Studio 2005web应用项目迁移到Visual Studio 2008</a> (1)</li>
	<li><a href="http://www.watch-life.net/aspnet/ergodic-children-controls.html" title="遍历页面上的所有控件 (2007-11-20)">遍历页面上的所有控件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/absolute-position-controls-on-copy-paste-or-drag-drop-from-toolbox.html" title="web developer tips (18):从工具箱粘贴或拖拽控件时进行绝对定位 (2009-07-07)">web developer tips (18):从工具箱粘贴或拖拽控件时进行绝对定位</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html" title="web developer tips (77):在ASP.NET启动启动页面级跟踪 (2010-03-23)">web developer tips (77):在ASP.NET启动启动页面级跟踪</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/maintain-scrollposition-after-post-back.html" title="web developer tips (75):PostBack后保持滚动条的位置 (2010-03-17)">web developer tips (75):PostBack后保持滚动条的位置</a> (1)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-merger-cell.html" title="在GRIDVIEW中合并单元格 (2007-12-18)">在GRIDVIEW中合并单元格</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/improve-performance-of-page-and-server-control-processing.html" title="web developer tips (22):提高页面和服务器控件加载速度 (2009-07-15)">web developer tips (22):提高页面和服务器控件加载速度</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
