ASP.NET AJAX NAME SPACE FOR CLIENT SIDE DEBUGGING


I have a samle application which contains examle for each client side debugging option. But here again describing each.
Sys.Debug.isDebug - You can identify during run time that whetehr you are in debug mode or release mode.
Sys.Debug.assert - You can put a conditional logic to check and based on that one message prompt will get once the condition fails. The last argument for this method determine that the prompt message needs the method name too.
Sys.Debug.trace  - You can publish a message to "Output" window. This can be either a variable value or any thing. Normally out put displaying in "Output" window. But if you placed an HTML "TextArea" control with ID ="TraceConsole", out put will display there too. My code conatins this TextArea. Here ID should be "TraceConsole".
Sys.Debug.clearTrace - You can clear the dislay window mentioned above.
Sys.Debug.fail  - You can just pass a message and enable the debugging point. Here no prompt will get
compare to Sys.Debug.assert. More over no conditions can't check.
Sys.Debug.traceDump - You can display the entire details of an "Object" type using this. No loops or iterations needed. Look at my code.

Look at my HTML code.  Paste it to your application and try


<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<script language="javascript" type="text/javascript">
function Assert() {
Sys.Debug.
assert(1 == 2, "One not equal to Two", true);
}
function trace() {
Sys.Debug.trace(
"Hi I am in 14th line");
}
function clearTrace() {
Sys.Debug.clearTrace();
}
function fail() {
Sys.Debug.fail(
"Some thing failed");
}
function traceDump() {
var obj = new Object();
obj.id =
"1";
obj.name =
"MIKE";
obj.country =
"USA";
obj.job =
"DOCTOR";
Sys.Debug.traceDump(obj,
"Details of 'obj':");
}

</script>
<title></title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<input type="button" value="Sys.Debug.assert" id="Sys.Debug.assert" onclick="Assert();" /><br />
<input type="button" value="Sys.Debug.trace" id="Sys.Debug.trace" onclick="trace();" /><br />
<input type="button" value="Sys.Debug.clearTrace" id="Sys.Debug.clearTrace" onclick="clearTrace();" /><br />
<input type="button" value="Sys.Debug.fail" id="Sys.Debug.fail" onclick="fail();" /><br />
<input type="button" value="Sys.Debug.traceDump" id="Sys.Debug.traceDump" onclick="traceDump();" /><br />
</div>
<b>Below read my trace details</b><br />
<textarea id="TraceConsole" cols="40" rows="10" style="background-color: Blue; color: White; font-weight: bold"></textarea>
</form>
</
body>
</
html>