2

I need a functionality for Itemupdating event on a custom SharePoint list to show a confirmation message to the users as a pop up using C#.

Any help would be appreciated.

user16023
  • 101
  • 2
  • 10
  • Why not implement the confirmation in javascript? That would be significantly simpler and easier than anything else. – Chloraphil Apr 15 '13 at 15:08
  • Could you please guide me how where to add the Javascript? I tried the following way, but this did not work. public override void ItemUpdating(SPItemEventProperties properties) { base.ItemUpdating(properties); Page page = new Page(); ScriptManager.RegisterStartupScript(page, GetType(), "MyScript", "confirm('Are you sure you want to modify this item ?);", true); } – user16023 Apr 19 '13 at 14:40
  • One approach would be to use SharePoint Designer to edit the source of the EditForm.aspx page and attach to the onclick event of the button. You would not need an event receiver at all. – Chloraphil Apr 19 '13 at 17:11

1 Answers1

1

ItemUpdating is a transitional event that happens only on the server-side so client interaction is simply not possible without breaking the update process itself and forcing a fail of some form back to the client.

Some client-side script that fires prior to the update submission (and perhaps updates a field value that could be used server-side) would be the best way to handle this.

Dave Wise
  • 13,181
  • 18
  • 19