我是 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();
}
非常感谢