ASP.NET MVC razor html出错
下面的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();
}