[2024]Digital Global Overview Report 2024 Meltwater.pdf
Introduction to ASP.Net Mvc3 with Razor
1. Introduction to MVC3 with
Razor
Manoj Kumar
Senior Consultant III
manoj.kumar@neudesic.com 28 June, 2012
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
2. The Trusted Technology Partner in
Business Innovation
August 2010 August 2010 July 2010 June 2010
Ranked as one of the top Ranked as one of the top Named Microsoft Partner of CRN Magazine's list of the
technology solution providers technology solution providers the Year Finalist in 2 separate largest solution providers in
in America by CRN Magazine in America by CRN Magazine categories North America
for the past 4 years. for the past 4 years.
2009 2010 2007 2008
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
3. MVC Pattern – A Conceptual View
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
4. What’s new in ASP.NET MVC 3
Multiple View Validation
Razor View Engine Dynamic ViewBag
Engine Support Improvements
Project Dialog
Global Filters New ActionResults VBHTML Support
Improvements
Improved
Porting MVC Script Granular
Task-based Helpers Dependency
Libraries to jQuery ValidateInput
Injection
Project Dialog
Add View Dialog Improved Caching JSON Binding
Extensibility
Improvements Support Support
Improvements
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
5. What’s new in ASP.NET MVC 3
Multiple View Validation
Razor View Engine Dynamic ViewBag
Engine Support Improvements
Project Dialog
Global Filters New ActionResults VBHTML Support
Improvements
Improved
Porting MVC Script Granular
Task-based Helpers Dependency
Libraries to jQuery ValidateInput
Injection
Project Dialog
Add View Dialog Improved Caching JSON Binding
Extensibility
Improvements Support Support
Improvements
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
6. What is Razor?
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
7. Razor
• Clean & Concise
• Based on Existing Languages
• Intellisense
• Code Colorization
• Unit Testing Support
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
8. Razor Fundamentals
@model syntax for specifying the type being passed to the view.
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
9. Multiple View Engine Support
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
10. Multiple View Engine Support
protected void Application_Start()
{
ViewEngines.Engines.Add(new SparkViewFactory());
…
}
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
11. Syntax Comparison
Web Forms <ul>
<% for (int i = 0; i < 10; i++) {%>
6 transitions <li><%=i %></li>
<%} %>
</ul>
<ul>
Razor @for (int i = 0; i < 10; i++)
2 transitions {
<li>@i</li>
}
</ul>
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
12. Dynamic ViewBag
• Accessible via properties
• Properties map to ViewData entries
• Late-bound
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
13. Dynamic ViewBag
<head>
<title>@ViewBag.Title<title>
</head>
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
14. Q&A
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
16. Thank You
Manoj Kumar
manoj.kumar@neudesic.com
The Trusted Technology Partner in Business Innovation
Products | Consulting Services | Managed Services
Editor's Notes
I have a demo for adding new views to this dialog.
I have a demo for adding new views to this dialog.
Remember the last note talk about embracing UX team and working closely with them