I have a controller method like this:
public ActionResult Create(string project_title)
{
return View(new ProjectViewModel()
{
Title = project_title
});
}
On another page, I want to take the value of a textbox, and send as a querystring parameter to this method.
My view on this page looks like this:
@using (Html.BeginForm("Create", "Project", FormMethod.Get))
{
<input type="text" id="project_title" name="project_title" placeholder="Title of your project" class="input-lg" />
<input type="submit" value="Get started" class="btn btn-success btn-lg" />
}
However, while I thought that would work, I get the following error:
No parameterless constructor defined for this object.