Author: zfive5 (zhaozidong)
Email: zfive5@yahoo.com.cn
After turning over "Aspx. Net advanced programming" in the afternoon, I have another impulse to write. Such a good function should be known to more people. In. add <% @ page trace = "true" %> to the aspx file, and then execute the aspx file. You will see more information in the original interface, request details, tracking information, control tree, Cookie set, header set, and server variables.
Aspx code:
Private void page_load (Object sender, system. eventargs E)
{
// Place user code here to initialize the page
Trace. Write ("trace1 ");
Trace. Warn ("warn1 ");
Trace. Write ("trace2 ");
}
The trace information section after execution is as follows:
CATEGORY message from first (s) from last (s)
Aspx. Page begin init
Aspx. Page end init 0.001612 0.001612
Trace1 0.002763 0.001150
Warn1 0.003155 0.000393
Trace 2 0.003240 0.000085
Aspx. Page begin prerender 0.003287 0.000047
Aspx. Page end prerender 0.003331 0.000044
Aspx. Page begin saveviewstate 0.003636 0.000305
Aspx. Page end saveviewstate 0.004491 0.000856
Aspx. Page begin render0.004559 0.000068
Aspx. Page end render 0.051202 0.046643
Yes, even the execution time is output.
Look at the cookie information output by the trace, and then look at the session ID. The value is the same. It seems that the session of Asp.net is implemented by Cookie!