I was working on some event handlers. I was trying to display a custom error message whenever a condition is met. So my code went like this:
properties.Cancel = true;Even though, the event was getting canceled, but to my surprise, the SharePoint always displayed a message as "%1!.512s!". I spent so much of time to figure out what was wrong. Finally, when I did googling, I was taken to this KB article where it is mentioned that it is a bug! :( Well, it was time to bang my head for some other reason!
properties.ErrorMessage = "Custom Error Message";