2

Apologies if this is a pretty basic question but I'm a relative SharePoint newbie and I've been trying to find an answer for this for a couple of days.

I have an SPToolBarButton that provide Delete functionality via its OnClick. However, I need to prompt the users with an 'Are you sure?' Yes/No modal dialog box.

I have attempted to use OnClientClick="return confirm('Are you sure?')" but can't find a way of picking up the user's selection from within my code-behind page.

Is this even the correct approach to use?

Thanks for reading.

1 Answer 1

2

If the user clicks "Cancel" in the confirm then it will return false and the postback cancelled.

Since there is no postback then the code-behind doesn't actually run - so no check of which button clicked is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.