我正在尝试绑定我的模型并得到错误未捕获引用错误:无法处理绑定"值:函数(){return ASP_Page_Views_Configuration_Index_shtml.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"
));
有什么想法吗?
使用model
而不是Model
:
@ko.Html.TextBox(model => model.SomeProperty)