Exposing the View Model to JavaScript in ASP.NET MVC(trycatchfail.com)

submitted by Matt_TCFMatt_TCF(946) 2 years, 5 months ago

View models make it easy to move data between your views and controllers in a strongly-typed manner, but what's the best way to leverage the view model from JavaScript? This post looks at some of the alternatives and presents a clean, simple way to convert the view model to an equivalent JavaScript object by using JSON on the master page.

add a comment |category: |Views: 393

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story