Backbone.js with ASP.NET MVC

  • 3 Answer(s)

       For improving  the framework with mvc, There is a way to prevent the copy of models is to serialize (json) the server side viewmodel and use it as the backbone or knockout model.

       The client side models already have the data on page load and It is not needed to connect the data through an ajax request during the page is 1st loaded. Only serializing the serverside viewmodel isn’t enough for backbone/knockout, but this is the initializing point. Perhaps the serialized model could be a property on the clientside model.

       About jquery templates, keep the jquery template in a partial view. This way they will easily provide the wanted view:

    <script id="SomeTemplate" type="text/x-jquery-tmpl">

       Alter the old application to increase the  jquery templates will take more time.

    Answered on November 29, 2018.
    Add Comment

      For doing project on backbone js,The underscore js is used . underscore.js is a dependency of Backbone and give the result on their own templating language.

     Backbone’s collection is connect all the models from the server and return them is possible using a save functionality that piggy-backs on Jquery’s ajax calls. Check that they are serialized through JSON.

      See the details of using Backbone with ASP.NET MVC 3 -0:

    Answered on November 29, 2018.
    Add Comment

    Use this ASP.NET MVC app as a RESTful service emitting JSON for the view-models. The Backbone models can straightly map to this JSON.

    Answered on November 29, 2018.
    Add Comment

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.