With visual studio 2010 Microsoft has given a new features called to add/edit label in break point. This features comes very handy when you are having very large code to debug and You are having so many break points to debug. So, You can add the label to various break point and then use this label to understand execution of program. Let’s see how its works with visual studio 2010.
I have written following sample code to understand it better. This is a simple default.aspx page with four method to print a string on web page.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
public void Method1()
public void Method2()
public void Method3()
public void Method4()
Here you can see there are four methods method 1,2,3 and 4 and each printing respective string with respective methods
Now Let’s put four break point in visual studio like following.
Now let’s debug the web application via pressing F5 and then we will go one by one break point and will add labels. Now I am at first break point.
Now when you go to the break point window you can see all the break point over there like following.
Now let’s Create a new label first for break point via selecting that row and right click edit label like following.
Once you click edit labels a window will appear which will ask for adding a new label for break point like following.
Now I am adding a new label called method1 label in this box.Now you can see the in break point window with a label just like following.
So now you can see the Method 1 Label is there so you need not to check this break point via clicking on that break point. You can remember this break point via clicking on this. That’s it. Hope you like it.. Stay tuned for more.. Happy Programming.