locked
Why can not call SPUtility.TransferToErrorPage in event handler? RRS feed

  • Question

  • Hi all
        Why can not call SPUtility.TransferToErrorPage in event handler or workflow?
    Monday, May 18, 2009 7:55 AM

Answers

  • If you are working with event handlers then you can set

    ErrorMessage property of SPItemEventProperties, this will redirect user to error page and will show the error message.

    thanks
    Spidy

    • Marked as answer by Paul Galvin Monday, May 18, 2009 12:06 PM
    Monday, May 18, 2009 9:49 AM

All replies

  • If you are working with event handlers then you can set

    ErrorMessage property of SPItemEventProperties, this will redirect user to error page and will show the error message.

    thanks
    Spidy

    • Marked as answer by Paul Galvin Monday, May 18, 2009 12:06 PM
    Monday, May 18, 2009 9:49 AM
  • You can't do it from a workflow because workflows run entirely separately and disconnected from the user interface.

    I think that event receivers are basically the same, especially the *added types.  Maybe a *adding event could use that.

    In any event, SpidyNet is right.
    --Paul Galvin, Arcovis
      Microsoft MVP - SharePoint
      Blogging @ http://feeds.feedburner.com/PaulGalvinsSharePointSpace
      Twitter @ http://www.twitter.com/pagalvin
    Monday, May 18, 2009 12:06 PM
  • fo those who enter this page by searching the same problem, it didn't work the cancel.. because I forgot a property :)

    only in the asynchronous events (itemupdating, itemcheckingout,...)

    properties.Cancel = true;


    MCT,MCTS - http://www.tomvangaever.be
    Sunday, October 11, 2009 1:13 PM