Q:

Controlling Controller Action call order

I'm knocking together a wizard like web app that will take input in a form and conditionally redirect to a confirmation page if the item entered already exists. Something along the lines of 
"there is already a product in the system with that name are you sure you wish to continue?".
I can have an action "Confirm" on my controller for this but this action should only ever be called by the initial "Add" action.
My question is, what's the best way to control controller action call order. Obviously someone could enter the //Confirm url and spoof the data. 
Hope I'm making sense.
Thanks,

A:

You want the user to confirm something sometimes, right?
If so, submit the form to the confirm action; then
public ActionResult Confirm(MyObject mObj, string confirmButton )
{

   if( NotAlreadyExists(mObj) || confirmButton )
      return RedirectToAction("Create", mObj)
  else
  {
      ModelState.AddModelError("DuplicateProduct","Please confirm");
      ViewData["showConfirm"] = true;
      return View(mObj);
 }
}

Ofourse, then you hardly need a special action, as you could simply place your datacontext create code instead of the RedirectToAction, but whatever...
The view will then need to look for showConfirm, and show the message + confirmation button.

