Sol Web Solutions Blog
Sol Web Solutions Blog is aimed to help, inform, educate and enable our site visitors.
Use Debugging to fix code
A user reported a bug in an ASP.NET web application, and after running several test scenarios it was difficult to see where the bug actually resided. Of course after much "hair pulling" and "keyboard banging", we turned to the debugger.
Initially, the breakpoint was just at the code block fired from a button click event. Within the first test, we could see the bug was somewhere outside of this button click event. Then, a second breakpoint was placed in the Page_Load event, and we caught the bug in a line which was a bit "over cautious" to help clean up the page. Remembering the ViewState was placed on serveral controls in question, we were able to take the lines of code out of the page postback and the application was working correctly.
Being able to step through each line with the debugging tool gave great insight on what property values were being assigned to the controls, and allowed the code to be fixed fairly quickly. The ASP.NET debugging tool provides great insight and with both step-into and step-over functionality, you can quickly go through your code and find where your changes need to occur.





Leave your comment