ASP.NET MVC 2 Best Practices by yal18555

VIEWS: 77 PAGES: 16

									Hattan Shobokshi
* Stuttering is a communication disorder
 involving disruptions, or “disfluencies,” in a
 person’s speech.

* Across all cultures, roughly 1% of people
 currently has a stuttering disorder.

* http://westutter.org/


        *
* Book raffle at the End.




         *
*Senior Software Engineer
*ASP.NET Web Forms & ASP.NET MVC
*Windows Mobile
*C#, VB.NET, VBScript, JavaScript…
*TSQL

*www.hattanshobokshi.com
*Email: hattan@gmail.com
* Static Content via Html Helpers

* T4 Templates

* Custom View & Controller Templates

* Diagnostic Tools

* Telerik Grid Control
* Use Url.Content for ALL static content

* Create HtmlHelper methods to simply the
 process




    *
* Code Generation Tool
* Built into Visual Studio (2008 and 2010)
* .tt File Extension
* No syntax highlighting by default
* Clarius Visual T4 Add-on
    http://www.visualt4.com/

* Tip: Windows 7/Vista unblock zip file, unblock individual files


*    More information
    http://www.olegsych.com/2007/12/text-template-transformation-
    toolkit/




                   *
* T4 template for ASP.NET MVC
* Creates strongly typed helpers
* Eliminates magic strings (View names, HtmlHelper
  parameters)
* http://mvccontrib.codeplex.com/wikipage?title=T
  4MVC
* http://forums.asp.net/1215.aspx

* http://blogs.msdn.com/b/davidebb/archive/2010/
 03/12/a-better-way-to-auto-run-t4mvc-when-you-
 build.aspx
*<%= Html.ActionLink(“New Dinner", “Create", "Dinners")%>
*<%= Html.ActionLink(" New Dinner", MVC.Dinners Create())%>

*<img src="/Content/nerd.jpg" />
*<img src="<%= Links.Content.nerd_jpg %>" />

*http://mvccontrib.codeplex.com/wikipage?title=T4MVC_doc
 &referringTitle=T4MVC
* Custom Tooling
* Customize Default View Templates
* Add new View Templates
* Customize Controller Template
* T4 Templates

  * ~\Microsoft Visual Studio
    10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 2
  * ~\Microsoft Visual Studio
    10.0\Common7\IDE\ItemTemplates\VisualBasic\Web\MVC 2
* Add Reference to Dll
* Enable route debugging with 1 line of code
 RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);


* http://haacked.com/archive/2008/03/13/url-routing-
 debugger.aspx
* Environment Information
* MVC Assembly Version
* Referenced Assembly Information
* Web Forms page, not an mvc page
* http://bradwilson.typepad.com/blog/2010/03
 /diagnosing-aspnet-mvc-problems.html
* http://demos.telerik.com/aspnet-mvc/
* Grid Control
  * Out of the box support for Sorting, Filtering
  * Out of the box paging support
  * Out of the box ajax support
  * Very little javascript you have to write! 




       *
* Static Content via Html Helpers

* T4 Templates

* Custom View & Controller Templates

* Diagnostic Tools

* Telerik Grid Control
* Email: hattan@gmail.com

* www.hattanshobokshi.com
Thank you!

								
To top