2
我是一個MVC3剃鬚刀的新手。任何人都可以請幫助我爲什麼我得到這個錯誤運行。MVC3 - 剃刀:傳遞查詢字符串時出錯
錯誤: Object reference not set to an instance of an object.
它打破上ActionLink的。
HTML代碼:
@model Solution.User
@using (Html.BeginForm())
{
@Html.TextBoxFor(model => model.Name, new {@id = "name-ref", @class = "text size-40"})
@Html.ActionLink("Go Ahead", "Index", "Home", new {name = Model.name, @class = "button" })
}
控制器
[HttpPost]
public ActionResult Index(string name)
{
return View();
}
非常感謝