I am trying to access a sharepoint list programmatically in a web part, for example.
try { masterList = web.Lists[listId]; } catch(Exception e) { RenderExceptionMessage(e.Message); }
The RenderExceptionMessage () method is supposed to display a user-friendly error message inside the web part.
But the problem is that I cannot catch the exception. Instead, the web page is redirected to the access denied page, which displays the error message "You are currently logged in as: Domain \ User"
In addition, the message about the catch exception reads "Unable to evaluate the expression because the code is optimized or the native frame is on top of the call stack."
Any idea why this behaves this way?
sharepoint moss sharepoint-2007
ashwnacharya
source share