Search code examples
jqueryasp.net-mvcjavascriptmvc

Javascript MVC framework (seperation of concerns) is compatible with asp.net MVC?


Anyone had a chance to use the javascript MVC framework with ASP.NET MVC?

Basically i looking for advise on a way of using them together if possible, my asp.net MVC app i can't get rid of but i would love to use some sort of separation of concern for the javascript / Jquery...

Anybody used something like this? I am trying to picture the 2 together, because asp.net mvc provides VIEWS maybe the 2 would be incompatible....??

Or would it be better to use just a OOP extension framework for javascript and if so ... anybody know a good one that would work side by side with asp.net mvc?


Solution

  • Mark, I'm another contributor to JMVC. JMVC is designed to work from raw data services, but it can wear many hats.

    It's based on thin server architecture. For example, instead of splitting creating views on both the server and the client, use asp.net to create raw JSON data, then pass it to JavaScript, which will use its templates to generate the final HTML structure.

    The advantage is that you've already created a reusable service, and your UI logic is all in one place (the client).

    However, you don't have to do things this way. You can decide where the best place to create view data.

    If your views are all server side (returning HTML from client requests), you might not even need many JMVC views. You would just use controllers. However, controllers are the best part of JMVC. They use event delegation so you don't have to worry about attaching events!

    Here's a post where I talk about our architecture with rails:

    http://javascriptmvc.com/blog/?p=68