views:

59

answers:

1

Hi,

I have an SPList event receiver method like:

ItemDeleting(ByVal voHttpContex As HttpContext, ByVal voProperties As Microsoft.SharePoint.SPItemEventProperties)

To block unwanted operation i uset this code:

voProperties.Cancel = True
voProperties.ErrorMessage="This is my error message."

After executing above code error message within error page is shown.

Is there a way to add to this error message html link to another page?

I was tying to use "a" html tag but it was displayed explicitly on page and wasn't recognized as a Html code to be transformed and parsed. Do anybody knows how to add this link to the message? Link should have of course some name like "click here" instead of "http://blablabla.bla" format.

+1  A: 

Unlikely by using ErrorMessage - whatever code in SharePoint is outputing this message is useing HTMLEncode and you're not going to be able to stop that.

With SP2010 .Cancel is depreciated and you could use Status = CancelWithRedirectUrl

voProperties.Status = CancelWithRedirectUrl;
// Redirect to some page that shows your error and provides link.
voProperties.RedirectUrl = "someurl.htm";
Ryan