There are two views (Game/Index.cshtml)[This Page] and (Game/Edit.cshtml).
The model on this page is an ADO.NET Entity Data Model (edmx).
The View() on the ActionResult Index() and model parameter to this page is, using EDM query syntax: "var qry = from g in _ctx.Games where g.GroupingID == id orderby g.Name select g;"
The Razor DropDownList's on change method is handled by a jQuery DOM element,
which calls a load method defined on the KnockOut View Model.
That load function makes a jquery Ajax call to a 'view' which is really a call
to the GameController public ActionResult GetGamesByGenre(int id) function.
The jQuery Ajax Callback then applies each Json response as a new item pushed onto the knockout View Model observableArray.
Selecting ShowItem allows an Edit all the way back to the database, any validation is down to bundling via WebGrease or database referential integrity.
The images are named relatively in the database fine for Internet Explorer and Crome but, yet another, not with Opera.
The model on this page is an ADO.NET Entity Data Model (edmx).
The View() on the ActionResult Index() and model parameter to this page is, using EDM query syntax: "var qry = from g in _ctx.Games where g.GroupingID == id orderby g.Name select g;"
The Razor DropDownList's on change method is handled by a jQuery DOM element,
which calls a load method defined on the KnockOut View Model.
That load function makes a jquery Ajax call to a 'view' which is really a call
to the GameController public ActionResult GetGamesByGenre(int id) function.
The jQuery Ajax Callback then applies each Json response as a new item pushed onto the knockout View Model observableArray.
Selecting ShowItem allows an Edit all the way back to the database, any validation is down to bundling via WebGrease or database referential integrity.
The images are named relatively in the database fine for Internet Explorer and Crome but, yet another, not with Opera.
Tags: Model, View, Controller, jQuery, Ajax, Json, Knockout: observableArray, data-bind="foreach: observableArray"