ASP.NET MVC Html.TextBox出错
下面的razor代码会出错
@using (Html.BeginForm())
{
<fieldset>
<legend>新用户注册</legend>
姓名:@Html.TextBox("name", ViewData["name"])
@*密码:
@Html.TextBox("name", ViewBag.pwd)*@
密码:@Html.TextBox("name", TempData["pwd"])
</fieldset>
}
Action
public ActionResult Demo2Index()
{
ViewData["name"] = Request["name"];
ViewBag.pwd = 123;
TempData["pwd"] = Request["pwd"];
return View();
}