Solved

how to trace

Posted on 2011-03-18
5
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

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

Author Comment

by:akohan
ID: 35169858

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
ID: 35169963
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
ID: 35169971
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
ID: 35307712
Thanks.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 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