1
我有一個控制器的方法是這樣的:使用FORM進行GET - 如何設置查詢字符串參數?
public ActionResult Create(string project_title)
{
return View(new ProjectViewModel()
{
Title = project_title
});
}
在另一頁,我要帶一個文本框的值,併發送作爲查詢字符串參數,此方法。
我在這個頁面查看看起來是這樣的:
@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" />
}
然而,儘管我認爲這會工作,我得到以下錯誤:
No parameterless constructor defined for this object.
你是對的。我開始設置我的windsor框架,忘了把它掛起來 - 呃!你剛剛救了我很長一段時間調試這個代碼...(注意自己:有時候牀)。謝謝! – 2014-08-28 21:31:35