Reputation: 14417
I have:
public ActionResult Create(Guid appId)
{
var vm = new CreateViewModel(appId);
return View(vm);
}
[HttpPost]
public ActionResult Create(CreateViewModel vm)
{
// this does some stuff
}
Now, in the View I use this for creating the Form:
@using(Html.BeginForm())
{
}
Standard.
How ever, it produces the wrong HTML:
<form action="/SomeController/Create?appId=414FDS-45F2SF-TEF234">
This is not what I want posted back, I don't want appId
what so ever. Just the Create
How do you get around this?
Upvotes: 0
Views: 694
Reputation: 56688
You can use another overload of Html.BeginForm
to explicitly specify the action you want:
@using(Html.BeginForm("Create", "SomeController"))
{
}
This will not append anything to the URL by default.
Upvotes: 5