Monday, October 5, 2009

Afternoon Session 2 - 'Real World' ASP.NET MVC in 75 Minutes!

Same guy as last time. Not the best presenter, but here we are.

Afternoon Session 2 - 'Real World' ASP.NET MVC in 75 Minutes!
Gus Emery

Custom Routing
Customization to urls
Keeps site secure (no exposure of real url)
MVC is type smart
Easily addable to global.asax. Miguel told us not to do that...
Default controller: {controller}/{action}/{index}

Never a good sign when he warns us to bear with him with all the issues he's expecting. Or it shows he's learning from last session.

Can also create partial views as ascx.

Form Validation
Use AddModelError to add an error to the model, then check ModelState.IsValid(). Note, requires a roundtrip to check, but 2.0 apparently has a better way (using jQuery I think).
Provides easy way to display errors (HtmlValidationSummary) and uses standard validators on fields.

Custom Filters
Allows custom functionality (logging, tracing)
Very flexible
Actually filtering on actions to let you log them.
Didn't really work (at all) in his demo, so not really sure....

Caching
Less DB hits
Faster
Basically tag any method with a cache. Things go faster. Can do a varyByParam to specify individual parameters that should be used to specify how to index your cache.

No comments:

Post a Comment