IsNullOrEmpty(form"step3")) { // Step 3 button wa..." />

Posting a form and redirecting to action ASP.NET MVC?

You can have multiple submit buttons on your form: input type="submit" name="step1" value="Step 1"/> IsNullOrEmpty(form"step3")) { // Step 3 button was clicked } ... }.

You can have multiple submit buttons on your form: and in your action: public ActionResult Action(FormCollection form) { if (!string. IsNullOrEmpty(form"step1")) { // Step 1 button was clicked } else if (!string. IsNullOrEmpty(form"step2")) { // Step 2 button was clicked } else if (!string.

IsNullOrEmpty(form"step3")) { // Step 3 button was clicked } ... }.

Without Javascript, a simple link can't submit via POST. You have to use a submit button to do it. Fortunately, HTML provides an easy way to do the image-submit-button: You can always add jQuery handling for the Javascript-able: $('#btnStep1').

Click(function(){...}).

Thanks looks like i'm going to have a form with 4 submit buttons. Though how do I then know what button was clicked? – ddd Jul 15 '09 at 22:03 1 If you give the button a name and a value, it will be passed like any other form input, e.g. BtnStep1=1.

– tghw Jul 15 '09 at 22:53.

You can use an attribute which I found on the net which handles multiple buttons on the same form. This will determine which action is executed on the controller. So, you could have 4 actions on the controller and the correct one is executed depending on which button was clicked irrespective of where it's called.So little example; markup ... Then in the controller ... HttpPost MultiButton(MatchFormKey = "action", MatchFormValue = "step1") public ActionResult Step1(/* parameters */) { ... } HttpPost MultiButton(MatchFormKey = "action", MatchFormValue = "step2") public ActionResult Step2(/* parameters */) { ... } HttpPost MultiButton(MatchFormKey = "action", MatchFormValue = "step3") public ActionResult Step3(/* parameters */) { ... } HttpPost MultiButton(MatchFormKey = "action", MatchFormValue = "step4") public ActionResult Step4(/* parameters */) { ... } You can then click between any step in the sign up process (probably once validation is done and you've gone through each first) with relative ease.

Hope this helps someone. I've just clocked the question post date but thought I'd post this anyway :-).

The ASP.NET MVC pattern of submitting forms via post, then redirecting to the same or different URL is very easy to code. User goes to /products/42/edit to view and edit product 42. They see something crazy on that page, edit it, and hit save.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions