I’m refactoring some piece of… code, part of huge, complex .Net project. There is a piece of code like
<asp:Button ID="btnSave" runat="server" CommandName="Update" ... />
Notice the command name, genius, who wrote the code called it simply Update. As the project is huge, you can imagine how many “Update” methods are there. I need to find that method very badly, is there any way I can get a call stack or something?
It might not be used anywhere, especially if there are no other buttons with other
CommandNames in this context.You will find it (if it exists) in the button click event handler, where the value would be compared against the string “Update”.
Assuming C#, it would be something like: