Archive for June, 2012

Custom Error Message for Event Receiver

June 20, 2012 1 comment


SharePoint default error are not user friendly, for that if you need to show your own error message for even receiver exception then what would you do ?

This blog post is simply and specially written to deal in that situation.

You just need assign your custom error message to properties.ErrorMessage

                        properties.ErrorMessage = This is my custom error message.;
                        properties.Cancel = true;

Moreover you can perform formatting with string for better presentation of your custom error message.


Setting Drop Down Selected Index programmatically.

June 9, 2012 4 comments

What is you need to select the item from the drop down list programmatically where you don’t know on which index it would be. For that simplest way is

Happy CodingSmile