我试图绑定我的模型并得到错误 未捕获的ReferenceError:无法处理绑定“value:function(){return ASP._Page_Views_Configuration_Index_cshtml.Model()。SomeProperty}” 消息:ASP未定义
查看:
@using PerpetuumSoft.Knockout
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/knockout")
@model Asteros.MKD.Controllers.SomeModel
@{
var ko = Html.CreateKnockoutContext();
}
@ko.Html.TextBox(model => Model.SomeProperty)
@ko.Apply(Model)
束:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
...
bundles.Add(new ScriptBundle("~/bundles/knockout").Include(
"~/Scripts/knockout-{version}.js",
"~/Scripts/knockout.mapping-latest.js",
"~/Scripts/perpetuum.knockout.js"
));
有什么想法吗?
答案 0 :(得分:1)
使用model
代替Model
:
@ko.Html.TextBox(model => model.SomeProperty)