In doing custom SharePoint development, we have all run into the dreaded "An unexpected error has occurred" which basically tells us nothing more than we already know. Check the ULS logs, check the Event Viewer...good luck there is nothing there.
The quickest way to get a good answer lies in the web.config file. I suggest making the following entries below...
Change:
<SafeMode CallStack="false"...
to:
<SafeMode CallStack="true"...
and
<customErrors mode="On"...
to:
<customErrors mode="Off"...
This will give you the stack trace of what was wrong in the code. I was able to use it to find the specific control on a particular page that was giving me the error.
Hope this helps!