際際滷

際際滷Share a Scribd company logo
MVC Views In DepthJoe WilsonVolare Systems, Inc.Email: joe@volaresystems.comBlog: http://VolareSystems.com/BlogTwitter: joe_in_denver
The BookSteve Sanderson, Pro ASP.NET MVC 2 Framework, Second Edition
AgendaWhat are Views?Master Pages and Partial ViewsEncodingCODE: Generating a view from a ModelCODE:HtmlHelpersCODE:Editor and Display TemplatesCODE:Model Validation
What are Views?Are .ASPX and .ASCX filesInherit from ViewPageHolds user interface elements (HTML, CSS, JavaScript)Views should not contain much logicSimple ifs or foreaches are OKSanderson: separating presentation from application logic
Master Page, View, Partial ViewsMaster PageViewPartial ViewPartial View
EncodingThese are equivalent:Use the shorter : syntax if in .NET 4
Code!
Templates  Customize
Templates  Customize
Templates  Customize

More Related Content

MVC Views In Depth