SlideShare une entreprise Scribd logo
1  sur  14
Module 6:
Tracing in Microsoft
  ASP.NET Web
   Applications
Overview

    Understanding Tracing
    Remote Debugging
Understanding Tracing

     Runtime Information
     Enabling Tracing
     Using the Trace Object
     Viewing Trace Results
     Using Application-Level Trace
     Demonstration: Tracing Through a Web Application
     Tracing into a Component
Runtime Information

     During runtime, you can:
         Output values of variables
         Assert whether a condition is met
         Trace through the execution path of the application
     You can collect runtime information using:
         The Trace object
         The Debug object
Enabling Tracing

     Page-level tracing displays trace statements only on the configured
      page
     Enabling page-level tracing
       <%@ Page Language="vb" Trace="true" %>

       <%@ Page Language="c#" Trace="true" %>


     Application-level tracing displays trace information for all pages in a
      Web application
     Enabling application-level tracing in the Web.config file
       <trace enabled="true" pageOutput="true"
       localOnly="true"/>

     Practice: Check default settings
Using the Trace Object

     Inserting trace messages
       Trace.Write ("category", "message")
       Trace.Warn ("category", "message")


     Conditional execution with Trace.IsEnabled
       If Trace.IsEnabled Then
          strMsg = "Tracing is enabled!"
         Trace.Write("myTrace", strMsg)
       End If

       if (Trace.IsEnabled)
       {
        strMsg = "Tracing is enabled!";
        Trace.Write("myTrace", strMsg);
       }

     Dynamically change state of trace
      Trace.IsEnabled = False
Viewing Trace Results
Using Application-Level Trace

      Page         Application                  Result
                 Trace=True or
 Trace=True                     Trace results are displayed on page
                 Trace=False
                 Trace=True or
 Trace=False                    Trace results are not displayed
                 Trace=False
 Trace not set   Trace=True        Trace results are displayed on page

     Application-level trace statements are displayed on
      individual pages
     Set pageOutput=false in the Web.config file and trace
      results are viewable by trace viewer
      http://server/project/trace.axd
Demonstration: Tracing Through a Web Application

             Page-level tracing
             Application-level tracing
Tracing into a Component

     Import the System.Web Library
      Imports System.Web        using System.Web;

     Enable Tracing
      HttpContext.Current.Trace.IsEnabled = True

      HttpContext.Current.Trace.IsEnabled = true;

     Call Trace methods
      HttpContext.Current.Trace.Write _
        ("component", "this is my trace statement")

      HttpContext.Current.Trace.Write
        ("component", "this is my trace statement");
Lesson: Remote Debugging

    How to Perform Remote Debugging
How to Perform Remote Debugging

    Remote debugging:
        Debug Web applications remotely
        Simplifies team development
        Simplifies Web site management
    Requirements for remote debugging:
        Requires Visual Studio .NET or remote components on the
         server
        Visual Studio .NET must be installed on the client
        Requires administrative access to the server
        Requires access for the user who is performing debugging
Review

    Understanding Tracing
    Remote Debugging
Lab 6: Tracing in Microsoft ASP.NET Web
   Applications
             Logon Page
             Login.aspx
                                          Benefits
Coho                                      Home Page                                      Page Header                 ASPState
Winery                                    Default.aspx                                   Header.ascx
                                                               Menu
             Registration                                      Component
             Register.aspx                                     Class1.vb or Class1.cs                  Web.
                                                                                                                      tempdb
                                                                                                      config



           Life Insurance                Retirement                Medical              Dental
           Life.aspx                     Retirement.aspx           Medical.aspx         Dental.aspx




                             Prospectus                  Doctors             User Control                  XML Web
          Lab Web            Prospectus.aspx             Doctors.aspx        namedate.ascx                 Service
         Application                                                                                       dentalService1.asmx



                                 XML
                                                            Doctors                                            Dentists
                                 Files

Contenu connexe

Tendances

ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsRandy Connolly
 
Corralation
CorralationCorralation
Corralationzpl
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.netSireesh K
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kitVidhi Patel
 
ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9Sisir Ghosh
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basicspetrov
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsRandy Connolly
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20HUST
 
Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services Zayen Chagra
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6Sisir Ghosh
 
Debugging Javascript
Debugging JavascriptDebugging Javascript
Debugging JavascriptSolTech, Inc.
 
Ajax Technology
Ajax TechnologyAjax Technology
Ajax TechnologyZia_Rehman
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10Sisir Ghosh
 

Tendances (20)

ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
Corralation
CorralationCorralation
Corralation
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
Ajax part i
Ajax part iAjax part i
Ajax part i
 
Lecture14
Lecture14Lecture14
Lecture14
 
Visual studio 2008 asp net
Visual studio 2008 asp netVisual studio 2008 asp net
Visual studio 2008 asp net
 
ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9
 
2310 b 05
2310 b 052310 b 05
2310 b 05
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basics
 
AJAX
AJAXAJAX
AJAX
 
Web controls
Web controlsWeb controls
Web controls
 
ASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation ControlsASP.NET 05 - Exception Handling And Validation Controls
ASP.NET 05 - Exception Handling And Validation Controls
 
Csphtp1 20
Csphtp1 20Csphtp1 20
Csphtp1 20
 
Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services Windows Phone Workshop: WCF services
Windows Phone Workshop: WCF services
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6
 
Ajax & ASP.NET 2
Ajax & ASP.NET 2Ajax & ASP.NET 2
Ajax & ASP.NET 2
 
Debugging Javascript
Debugging JavascriptDebugging Javascript
Debugging Javascript
 
Ajax Technology
Ajax TechnologyAjax Technology
Ajax Technology
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 

En vedette

En vedette (6)

Android datastorage
Android datastorageAndroid datastorage
Android datastorage
 
Android stepbystep
Android stepbystepAndroid stepbystep
Android stepbystep
 
2310 b 01
2310 b 012310 b 01
2310 b 01
 
Android search
Android searchAndroid search
Android search
 
Android security
Android securityAndroid security
Android security
 
2310 b 02
2310 b 022310 b 02
2310 b 02
 

Similaire à 2310 b 06

C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questionsAkhil Mittal
 
Monitoring, troubleshooting,
Monitoring, troubleshooting,Monitoring, troubleshooting,
Monitoring, troubleshooting,aspnet123
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with spparallelminder
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Vivek chan
 
Integrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointIntegrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointRob Windsor
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh Kushwah
 
Microsoft asp.net online training
Microsoft asp.net online trainingMicrosoft asp.net online training
Microsoft asp.net online trainingSanthosh Reddy
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGtraining3
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGSanthosh Sap
 

Similaire à 2310 b 06 (20)

C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Monitoring, troubleshooting,
Monitoring, troubleshooting,Monitoring, troubleshooting,
Monitoring, troubleshooting,
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
Integrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointIntegrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePoint
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
Microsoft asp.net online training
Microsoft asp.net online trainingMicrosoft asp.net online training
Microsoft asp.net online training
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
 

Plus de Krazy Koder (17)

2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xc
2310 b xc2310 b xc
2310 b xc
 
2310 b xb
2310 b xb2310 b xb
2310 b xb
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
2310 b 14
2310 b 142310 b 14
2310 b 14
 
2310 b 12
2310 b 122310 b 12
2310 b 12
 
2310 b 10
2310 b 102310 b 10
2310 b 10
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 07
2310 b 072310 b 07
2310 b 07
 
2310 b 04
2310 b 042310 b 04
2310 b 04
 
2310 b 01
2310 b 012310 b 01
2310 b 01
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
 
Android graphics
Android graphicsAndroid graphics
Android graphics
 

2310 b 06

  • 1. Module 6: Tracing in Microsoft ASP.NET Web Applications
  • 2. Overview  Understanding Tracing  Remote Debugging
  • 3. Understanding Tracing  Runtime Information  Enabling Tracing  Using the Trace Object  Viewing Trace Results  Using Application-Level Trace  Demonstration: Tracing Through a Web Application  Tracing into a Component
  • 4. Runtime Information  During runtime, you can:  Output values of variables  Assert whether a condition is met  Trace through the execution path of the application  You can collect runtime information using:  The Trace object  The Debug object
  • 5. Enabling Tracing  Page-level tracing displays trace statements only on the configured page  Enabling page-level tracing <%@ Page Language="vb" Trace="true" %> <%@ Page Language="c#" Trace="true" %>  Application-level tracing displays trace information for all pages in a Web application  Enabling application-level tracing in the Web.config file <trace enabled="true" pageOutput="true" localOnly="true"/>  Practice: Check default settings
  • 6. Using the Trace Object  Inserting trace messages Trace.Write ("category", "message") Trace.Warn ("category", "message")  Conditional execution with Trace.IsEnabled If Trace.IsEnabled Then strMsg = "Tracing is enabled!" Trace.Write("myTrace", strMsg) End If if (Trace.IsEnabled) { strMsg = "Tracing is enabled!"; Trace.Write("myTrace", strMsg); }  Dynamically change state of trace Trace.IsEnabled = False
  • 8. Using Application-Level Trace Page Application Result Trace=True or Trace=True  Trace results are displayed on page Trace=False Trace=True or Trace=False  Trace results are not displayed Trace=False Trace not set Trace=True  Trace results are displayed on page  Application-level trace statements are displayed on individual pages  Set pageOutput=false in the Web.config file and trace results are viewable by trace viewer http://server/project/trace.axd
  • 9. Demonstration: Tracing Through a Web Application  Page-level tracing  Application-level tracing
  • 10. Tracing into a Component  Import the System.Web Library Imports System.Web using System.Web;  Enable Tracing HttpContext.Current.Trace.IsEnabled = True HttpContext.Current.Trace.IsEnabled = true;  Call Trace methods HttpContext.Current.Trace.Write _ ("component", "this is my trace statement") HttpContext.Current.Trace.Write ("component", "this is my trace statement");
  • 11. Lesson: Remote Debugging  How to Perform Remote Debugging
  • 12. How to Perform Remote Debugging  Remote debugging:  Debug Web applications remotely  Simplifies team development  Simplifies Web site management  Requirements for remote debugging:  Requires Visual Studio .NET or remote components on the server  Visual Studio .NET must be installed on the client  Requires administrative access to the server  Requires access for the user who is performing debugging
  • 13. Review  Understanding Tracing  Remote Debugging
  • 14. Lab 6: Tracing in Microsoft ASP.NET Web Applications Logon Page Login.aspx Benefits Coho Home Page Page Header ASPState Winery Default.aspx Header.ascx Menu Registration Component Register.aspx Class1.vb or Class1.cs Web. tempdb config Life Insurance Retirement Medical Dental Life.aspx Retirement.aspx Medical.aspx Dental.aspx Prospectus Doctors User Control XML Web Lab Web Prospectus.aspx Doctors.aspx namedate.ascx Service Application dentalService1.asmx XML Doctors Dentists Files