Pages

Advertisement

Monday, July 9, 2007

Enabling Tracing and adding own trace message ...

Save this file as default.aspx 
<%@ Page Trace="true" %>
<
script runat="server">
Sub page_load
dim strTraceMessage as string

Trace.Warn("Page _Load event executing")
strTraceMessage="Welcome To S3 Tech Blog !"
Trace.Write("The Value of strTraceMessage is " & strTraceMessage)
End Sub
</script>

<
html>
<
head runat="server">
<title>S3 Tech Blog| Trace Example</title>

</head>
<
body>
<h2>Testing Page Trace ..</h2>
<h3>Here u can see 2 types of trace colors in Red and Black </h3>
<li>The trace message in red comes comes due to Trace.warn Whereas Black highlights due to Trace.Write</li>
<h3>The warn and write both are same are same the only diference is the color .. So don't get confused in this .</h3>

<%Trace.Warn("Rendering Page content....") %>
</
body>
</
html>

The Result is here ... 
 

No comments: