Tweaking T4 Templates to Improve Script Performance

Download

Right click “Save as…”

In this DevNugget, a follow-up to part 1, Make Script Performance Automatic with Custom Templates in Visual Studio 2010, Developer Evangelist G. Andrew Duthie shows you how you can customize the T4 templates used for creating new Views in an MVC3 application, to move script references to the bottom of the page. Why the bottom? As explained in the previous installment, because some browsers won't load any additional content while they're busy downloading a script, so if you're loading a large script file from an external site, or if that external site isn't available, your entire page may be blocked from loading. Yikes!

Along the way, you'll learn a bit about quickly creating an MVC3 application using Entity Framework Code First and MVC3 Scaffolding.

For those of you who like your tutorials in step-by-step format, check out the accompanying blog post at devhammer.net.

Some additional resources:

Tags:

Follow the Discussion

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.