INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ASP.Net Troubleshooting

Displaying TRACE data by putrtek
Posted: 26 Apr 07

I Complied this tip from several places on the Internet

Add this code to the very beginning of your Page Load event...

CODE

If Request.QueryString("trace") = "true" Then
    Trace.IsEnabled = True
End If

Then add

CODE

&trace=true

To the end of your URL when ever you want to get TRACE information


Here is a addon to this...

If you are updating data and want to see what paremeters are being passed to your Stored procedure

Add this proc to the code behind file

CODE


      Protected Sub SqlDataSource_Insert_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SqlDataSource_Insert.Inserting
        For x As Integer = 0 To e.Command.Parameters.Count - 1
            Trace.Write(e.Command.Parameters(x).ParameterName)
            Trace.Write(e.Command.Parameters(x).Value)
        Next
    End Sub

This proc assumes your data source is called 'SqlDataSource_Insert' change this is it's not.

This proc combined with the '&trace=true ' from above will write out all the parameters being passed by your page to the TRACE

Pretty cool...

Back to Microsoft: ASP.NET FAQ Index
Back to Microsoft: ASP.NET Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close