Solved

how to trace

Posted on 2011-03-18
5
271 Views
Last Modified: 2013-12-17


Hello,

how can I trace an asp code? I'm using VS 2010 and need to trace following code. Is it possible?

Thanks!

<asp:Button ID="btnAddToCart" runat="server" OnCommand="OnCommand" Text="add to cart"
                        CommandName="AddToCart" CommandArgument='<%#Eval("ProductVariantId")%>' CssClass="productvariantaddtocartbutton" />

Open in new window

0
Comment
Question by:akohan
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:SunnyDark
Comment Utility
You should be able to just put a break point, why that's not an option?
0
 

Author Comment

by:akohan
Comment Utility

In C# code it shows up when I create a break point but in javascript it doesn't show any thing!


0
 
LVL 1

Expert Comment

by:hank2011
Comment Utility
you could do a few things in asp enable the tracing for a page writing a trace message using TraceContext.Write or TraceContext.Warn or simply use the breakpoint. There is also a application level tracing.
0
 
LVL 1

Accepted Solution

by:
hank2011 earned 500 total points
Comment Utility
example in c#

 If (Trace.IsEnabled) {
    For (int i=0; i<ds.Tables["Books"].Rows.Count; i++) {
         Trace.Write("Prod",ds.Tables["Books"].Rows[ i ] [0].ToString());
    }
}
[Visual Basic]
If Trace.IsEnabled Then
    For i=0 To ds.Tables("Books").Rows.Count-1
        Trace.Write("Prod",ds.Tables("Books").Rows( i )(0).ToString())
    Next
End If


or

Context.Trace.Write("My Class","This is a sample trace statement.");
[Visual Basic]
Context.Trace.Write("My Class","This is a sample trace statement.")

or

Trace.Warn("Render", "Text is about to render.");
[Visual Basic]
Trace.Warn("Render", "Text is about to render.")


 
0
 

Author Closing Comment

by:akohan
Comment Utility
Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now