Send the link below via email or IMCopy
Present to your audienceStart remote presentation
- Invited audience members will follow you as you navigate and present
- People invited to a presentation do not need a Prezi account
- This link expires 10 minutes after you close the presentation
- A maximum of 30 users can follow your presentation
- Learn more about this feature in our knowledge base article
Journey from Web Forms to ASP.NET MVC 4
Transcript of Journey from Web Forms to ASP.NET MVC 4
Why not ASP.NET Web Forms?
Main disadvantages of Web Forms:
1 - ViewState weight;
2 - Page life cycle;
3 - Limited control over HTML;
4 - Low testability.
New Application Structure
Razor changes (new in ASP.NET MVC 4)
Custom attributes for actions in controllers
Is that all?
From vision to implementation
1 - Install ASP.NET MVC 4.0 and ASP.NET Web Pages;
2 - Add folders (Views, Scripts etc.), configure Web.config in existing project, configure Web.config in folder Views;
3 - Configure routing.
And a lot of partial views...
1 - Forget about @Url.Content
@Html.DisplayFor still doesn't save the state
Solution: create @Html.HiddenFor
2 - Conditions
1 - Set attributes on the fields;
4 - Enjoy!
1 - Register bundles for js scripts and css files
2 - Add bundle to the page... and enjoy!
1 - Add custom attribute inherits ActionMethodSelectorAttribute
2 - Use attribute with your actions... and enjoy!
Thank you for your attention!
And... Go-go-go to develop new things!
1 - View Case page
2 - Edit Case page
Why ASP.NET MVC?
Main advantages of ASP.NET MVC:
1 - Extensibility;
2 - Tight Control over HTML and HTTP;
3 - Testability;
4 - Powerful Routing System.
... but we have a better solution...
3 - Enable unobtrusive js in Web.config (for client validation)
2 - Set validation messages for fields;