views:

66

answers:

1

Hello,

I use MVC2/asp.net and try to develope something like a wizard. This wizard will have serveral websites. The user will be able to enter some information on website A and to navigate then to website B (by pressing a button which triggers the Http.Post event). No problem up to this point.

Also on website B can the user enter some information. But there he has two buttons: "Back" and "Forward".

How to identify here which button was pressed?

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Step2(Model model, FormCollection Form)
{
 ...
}

The "Back" / "Forward" buttons look like this:

input type="image" name="BackButton" id="BackButton" src="http://...whatever.../Resources/Images/Button/BackButton.gif" alt="Back" />

input type="image" name="ForwardButton" id="ForwardButton" src="http://...whatever.../Resources/Images/Button/Forward.gif" alt="Forward" />

+1  A: 

By looking through FormCollection Form only the button that did the postback should be present if I remember correctly.

and in mvc2 you can type [HttpPost] instead of [AcceptVerbs(HttpVerbs.Post)]

Joakim
Thank you very much for your fast and good replay!You are right. FormCollection contains only the pressed button.