locked
Debugging breakpoint on a textbox? RRS feed

  • Question

  • User1023690892 posted

    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?

    Thanks,

    Thursday, October 4, 2018 2:25 PM

Answers

  • User753101303 posted

    Hi,

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 4, 2018 3:38 PM

All replies

  • User753101303 posted

    Hi,

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 4, 2018 3:38 PM
  • User1023690892 posted

    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; .

    Thanks,

    Thursday, October 4, 2018 4:33 PM