Just to add something to the answer from Mattias:
1) he's right - if you want some information where to redirect place it in a hidden field or add it as parameter to the Form-Method.
2) The pattern, which is common in MVC is PRG (Post/Redirect/Get) so essentially your POST should answer with a RedirectToAction("Screencast") instead of view. (http://en.wikipedia.org/wiki/Post/Redirect/Get)
To use this you should refactor your functions a little bit:
public ActionResult Screencast(int ID)
{
mvm = new ViewModels.MediaViewModel(ID); //The id is in the viewmodel i think
return View(mvm);
}
[HttpPost]
//Even if unused include the formcollection for cases where the GET has the same signature
public ActionResult Screencast(int ID, MediaViewModel mvm, FormCollection collection)
{
//Do something
return RedirectToAction("Screencast", new { id = ID });
}
And inside your view:
@using(Html.BeginForm("Screencast", new { id = Model.SelectedMediaItem }))
{ ... }
- It might be that the suggested overload needs more parameters, but you will see that ...