There are two steps you need to perform in order to configure SharePoint for detailed ASP.Net error messages,  avoiding the standard SharePoint Error screen (which is sometimes not very informative). I always forget the second step so I thought I'd write it down here!

Modify web.config in two places....

1. Change the customErrors mode to RemoteOnly:

<configuration>

  <system.web>

    <customErrors mode="RemoteOnly" />

2. Set the SafeMode CallStack to true:

<configuration>

  <SharePoint>

    <SafeMode CallStack="true"

You will now get detailed ASP.Net error messages when browsing locally on the SharePoint server.