Controller
public ActionResult Index()
{
ViewBag.Ccuser = xxxx;
return View();
}
cshtml 将值付给input
@using Lead.Objects.Domain
@using Lead.OA.Utils
@{
Layout = "~/Views/Shared/_List.cshtml";
}
<input id="test"/>
@section scripts{
$(function () {
$("#test").val(ViewBag.Ccuser);
});
}