I am working on creating event receiver on a specific custom list using visual studio 2010. Below is the screenshot of the error message set on properties. ErrorMessage I'm interested in knowing how can we customize this form? Any suggestions?

|
|
||||
|
|
|
If you do something like the following in your code:
Then make sure to reverse the updates you made to the web.config file to show the full errors. (Reference) If all is done correctly you should see a screen very similar to SharePoint's "Unknown Error" but it will display the value in ErrorMessage instead. |
|||||||||||||
|
|
I think that error is caused by something else in your event receiver code, the error message shown by properties.ErrorMessage should be something like this:
|
|||||
|
|
As James Love pointed out, the screenshot in the original question is an IIS error page, not a SharePoint error page. Your code likely has a run-time error and is throwing an exception (specifically in this case, you are doing something wrong with an SPWeb or SPSite object). If you want to customize that page you need to fiddle with your web.config, but I would not recommend it. Fix the error before proceeding further. To show a custom SharePoint error page in your event receiver, use the following code in your method:
Then deploy that Application page there and have it display the error message in the query string. |
|||
|
|
|
To obtain more information regarding your error - make changes to the Web.Config sections are described in this post - SharePoint Web.Config: How to Show Full Errors |
|||||||
|
