Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
When adding a web part to a Web Page in DESIGN MODE OR implicitly RUNNING a web part when you load a page,you might face issues like the page not loading due to recent code changes in the web part code.
Here are some basic steps to troubleshoot and Debug the code in your SharePoint web part.
** IMPORTANT NOTE: The steps should ONLY be really used in your DEVELOPMENT ENVIRONMENT. Once you are done with your debugging\troubleshooting – please REVERT your edits. If these changes get into your production site they could cause security\performance issues. To make it simple make a copy of your web.config before you start.
Viewing the CALL STACK on your web page – Open your SharePoint Web Site’s web.config
DEBUGGING CODE in your Web Part using Visual Studio 2005\2008
Set the debug flag to true in web.config < compilation batch="false" debug="true">
Remember Me