Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Modern Web Development

Embed code for this video

Copy the code above to embed our video on your website/blog.

Close

Video format

Option selected may change based on video formats available and browser capability.

Close

Download

Right click “Save as…”

In this talk, Shawn will walk the attendees through the new way that web applications are being built today using the latest in client-side development the best practices of how to carry that out with ASP.NET MVC.

Follow the Discussion

  • Andrew LiangAndrew Liang

    Thanks for the great video. Your clarity and elegance matches Scott Hanselman's. :)

    You have mapped your javascript initialization code to your view and controller. However, using this pattern, how would we implement views and javascipt code that are shared by two controllers? We would require two javascript files with virtually the same code. For example, if you have two controllers, Home and Account, and they both have an Index view that require the same javascript code, then two files need to be created that have the same code (ie: Home-Index.js and Account-Index.js) with the exception that they will be created with different object names.

    Most of the javascript code I have written/read, from my experience, are designed to work very closely with the view file and the model that's passed from the controller to the view. In my opinion, the javascript code shouldn't care what controller is used.

  • Shawn Wildermuthswildermuth MVP, Speaker and Author.

    Thanks Andrew. As far as the controller/view pattern I am using here. The goal of the home-index.js pattern is to quickly implement the initialization for a page. It is common for me to have the same underlying implementation called by both pages. So in your example, I'd simply put the code that two pages share in a JavaScript 'class' or 'module' and call from each initializer.

Remove this comment

Remove this thread

close

Comment on this Session

Already have a Channel 9 account? Please sign in