1

How does one handle a user confirmation when using MVP/MVC in a Web environment?

Presenter:

if (_view.AskUserForConfirmation())
{
  // do something
}

In a winforms project this won't be any problem but in a web environment the confirmation answear will come one postback after the preseter code, how does one handle such a thing?

Marcus
  • 1,866
  • 1
  • 20
  • 33

1 Answers1

1

Basically you don't...

Asking confirmation is in pure MVP not a responsibility of the Presenter. The logic in the presenter is called after the confirmation. I can understand what you are trying to achieve here but it is not possible to go back to the user during a Postback, request confirmation (or some other data) and use the result on the point where you left the routine.

Either accept that it is not presenter logic and that the logic of the view asked the confirmation, or redesign your application to use multiple views of which one asks for confirmation (Wizard style).

TurBas
  • 1,646
  • 13
  • 15