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

1 hour, 17 minutes, 11 seconds


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

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • 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


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.