Last post Oct 04, 2018 04:33 PM by BFasano
Oct 04, 2018 02:25 PM|BFasano|LINK
Is it possible in VS2017 to assign a breakpoint to a specific text box?
I'm maintaining some very poor spaghetti code that it looping through rows in tables, then cells in each row, then controls in each cell and setting properties, like .Enabled and .ReadOnly on various controls. (And this is happening from multiple deeply
nested functions that unfortunately don't even use the same loop variable names...
Is there an easy way to watch for when the .Enabled value gets changed?
Oct 04, 2018 03:38 PM|PatriceSc|LINK
I don't think you have this out of the box in VS for managed code (ie "data based breakpoints").
The control you want to check is created from the ASPX markup ? If yes, you could use the https://www.codeproject.com/articles/667404/tag-mapping-in-asp-net feature.
You'll keep all your pages unchanged but behing the scene it will use now your own custom control. You can then override the code for the property you want and put a code breakpoint when a particular property is read or written.
Once done comment this tagMapping config and you are back to usual business.
Oct 04, 2018 04:33 PM|BFasano|LINK
Oooh, this looks like it will be VERY helpful. And it's very easy to implement.
This is exactly what I needed to find the function that was changing the value on me. It also helped me to track down a bug in the code that I'd converted from RemoveAt() on the table to making the row.Visible = false; .