----------------------------------------------------------- New Message on MumbaiUserGroup
----------------------------------------------------------- From: Swapnil_B1 Message 1 in Discussion Using ASP.NET Trace to Explore Web Pages The trace facility that is included in ASP.NET can be used to troubleshoot and diagnose problems with your Web site. You can also use the trace facility to explore resource usage on each Web page. This lesson covers the enabling and configuring of the trace facility and then explores the data that is made available by the trace facility. Enabling and Configuring the ASP.NET Trace Facility The trace facility can be enabled in the Web.config file, but you can use the Web Site Administration Tool to provide a user-friendly GUI to enable and configure this option. This section demonstrates the enabling and setting of the ASP.NET trace facility options. Enabling the Trace Facility Using the Web Site Administration Tool The following steps identify how to enable and configure the trace facility using the Web Site Administration Tool: Open the Web Site Administration Tool by selecting Website | ASP.NET Configuration. Click the Application tab and click the Configure debugging and tracing link to view and modify the trace settings. Click Capture Tracing Information. This enables the trace facility. Change the settings as necessary. Below Para describes each of the settings. Capture tracing information - Enabled - Enables the trace facility. When this option is enabled, the other trace options are also enabled. Display tracing information on individual pages - pageOutput - Displays the trace information directly on the Web page that is being traced. Depending on the page content, the trace information displays either at the bottom of the Web page or behind the regular Web page content. Display trace output for - localOnly - Designates either Local requests only or All requests. When set to Local Requests Only, the trace facility only operates with requests and PostBacks from the computer that the Web server is running on. The All requests setting enables the trace facility to respond for all requests and PostBacks from any computer to the Web site. Select the sort order for trace results - traceMode - Enables sorting of the trace output either by time or by category. Number of trace requests to cache - requestLimit - Sets the quantity of items to hold in the cache. Select which trace results to cache - mostRecent - Designates the Most Recent Trace Results or the Oldest Trace Results. When set to Most Recent Trace Results, the cache continues to update, holding the latest results. When set to Oldest Trace Results, as soon as the number of requests has been met, the cache no longer updates until after the Web application is restarted. Run the Web application. Navigate to the trace.axd page on the Web application (http://server/application/trace.axd). This is not a physical Web page. Instead, trace.axd is a virtual page that is constructed dynamically based on the Web pages you visited, and displays the trace data that is available. Enabling the Trace Facility in the Web.Config File The ASP.NET trace facility can also be enabled in the Web applications Web.config file. You do so using the following steps: Open the Web.Config file for your site. This is an XML file that contains settings for the Web site. Locate the trace element, which looks something like this. <trace enabled="false" requestLimit="10"pageOutput="false" traceMode="SortByTime" localOnly="true" mostRecent="true" /> Change the settings as necessary. Run the Web application. Navigate to the trace.axd page on the Web application (http://server/application/trace.axd) to display the trace data that is available. Viewing the Trace Data After turning on the ASP.NET trace facility, you can either view the trace output on each Web page (pageOutput="true"), or view the trace output by navigating to the trace.axd (http://server/application/trace.axd) page on the current Web application. When navigating to the trace.axd page, a summary page displays, which contains the list of results that are in the cache. Click on one of the cached results to view the result of a single page request, which is similar to the resultant information that is shown on each Web page when the page output is set to True. The trace result page is broken into sections. This information can be very useful when you are trying to identify performance issues and resource usage. Trace Result Section Description. Request Details Provides general details about the page request. Trace Information Displays performance information related to the Web pages life-cycle events. The From First(s) column displays the running time from when the page request started. The From Last(s) column shows the elapsed time since the previous event. Control Tree Displays information about each control on the Web page, such as the size of the rendered controls. Session State Displays all Session variables and their values. Application State Displays all Application variables and their states. Request Cookies Collection Displays the list of cookies that are passed to the server as part of the request. Response Cookies Collection Displays the list of cookies that are passed to the browser as part of the response. Headers Collection Displays the list of HTTP headers that are sent to the Web server as part of the request. Form Collection Displays the list of values that are posted back to the Web server. QueryString Collection Displays the list of values that are included in the query string. Server Variables Displays all server variables. Swapnil (Swaps) http://swapsnet.spaces.live.com/ ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
