views:

57

answers:

1

I want to redirect to an action, and post to the action instead of get (and post the key: ID, with value 100).

is this possible?

+1  A: 

As long as the originating action is a POST, you should be able to redirect to any action. The originating action needs to be a POST to trigger the submission of the form values. After that, simply pass the FormCollection (or whatever storage medium you wish to the redirected action.

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult OriginalSubmit(FormCollection formValues)
{
    ...
    return RedirectToAction("RedirectSubmit", Int32.Parse(formValues["ID"]));
}

public ActionResult RedirectSubmit(int id)
{
    ...
}
Neil T.