Asp+ asp+ Tracking
Sunadm http://www.aspgreat.com
How do I track the execution of an ASP program? I think a lot of people will use "Response.Write" to answer! No doubt
, this is not a good phenomenon:(
As an ASP granted extension, it is not called ASP 4.0 and called asp+, then the ASP "+" in the end provides what
What do you mean by the tracing of our "pathetic bugs"?
Perhaps this is the greatest feature of asp+ (for ASP: P)--asp+ provides a built-in tracing generation
Code, and it is added to the asp+ page!?? (bricks??) :( Don't do that! I haven't finished yet! )。
It can be used either on the page or throughout the application. This means that you can easily
The code will be tracked to join the application and shut down when you publish/deploy the tracing. When the full
After the page has been compiled, the TACE statement only has an effect on the compiled code that tracing opens.
To open the tracing, you will get a set of tables at the end of the page that contain the following information:
1, request details. including session Id,status Code, time, etc.
2, tracking information. Displays the category, information, and time of the trace information
3, the control tree. Displays the controls on this page, their IDs, and how big they are
4. Collection of cookies. Show cookie name, value, and size
5, headers collection. Displays HTTP headers, such as host,referrer and user agent strings
6, server variables. Displays a collection of all the server variables.
If you add your own tracking information, they will be displayed as part of the "tracking information".
Page-level Tracking
To make tracking of a page valid, you must include the following indication code:
<%@ Page trace= "True"%>
You can also add a sort
<%@ Page trace= "True" tracemode= "SortByTime"%>
Or
<%@ Page trace= "True" tracemode= "SortByCategory"%>
The default is sorted by time
Tracing statement:
Trace.Write ("My Program", "Name is" +txtname);
The first parameter is the category and the second is the trace information
Look at the example below, you can run this code at the aspgreat.com or dotnetcn.com aspx test site, Address:
Http://61.142.73.250/test/pagetrace.aspx
<%@ Page trace= "True"%>
<title> Use tracking </title>
<script language= "C #" runat= "Server" >
void Page_Load (Object Sender, EventArgs E) {
Trace.Write ("Tracking", "on page load");
}
void SubmitBtn_Click (Object Sender, EventArgs E) {
Trace.Write ("button", "button pressed");
Trace.Write ("Account", "Account is:" + name.text);
Trace.Write ("Password", "Password is:" + password.text);
Youentered.text = "Hello!" "+ Name.text +". Your password is "+ Password.text;"
}
</script>
<form runat= "Server" >
<table border= "0" >
<tr>
<td> Account </td>
<td><asp:textbox id= "Name" runat= "Server"/></td>
</tr>
<tr>
<td> Password </td>
<td><asp:textbox id= "Password" textmode= "Password"
runat= "Server"/></td>
</tr>
<tr>
<td></td>
<td><asp:button id= "submitdetailsbtn" text= "Submit"
onclick= "SubmitBtn_Click" runat= "Server"/></td>
</tr>
</table>
<p><asp:label id= "youentered" runat= "Server"/></p>
</form>
</body>
So that you can see exactly what's going on in the page.
Application-level tracking
Open application-level tracing, asp+ will record page tracking information
To turn on application tracing, simply modify the asp+ configuration file config.web in the root directory of the application.
Join:
<configuration>
<trace enabled= "true"/>
</configuration>
Can.
Access to trace information trace.axd the application directory
such as: Http://61.142.73.250/test/trace.axd
Here, you will see a list of each request and click View Details to see detailed trace information
。
2000-10-12 12:10
Sunadm
Www.ASPGreat.com