2. AGENDA
What is ASP.NET MVC?
ASP.NET MVC Power.
ASP.NET Web Forms vs. ASP.NET MVC.
MVC Life Cycle.
Advantages.
3. Model - represents the logic of the application
Controller - responsible for handling all user input
View - the visual representation of the model
What is ASP.NET MVC?
7. Pass Data from controller to a View
With ViewData:
ViewData["message"] = "HelloWorld!";
With ViewBag:
ViewBag.Message = "Hello World!";
8. Pass Data from Controller to Controller
With TempData:
TempData["name"] = “Neel";
@{
TempData.keep(“name”);
}
@ {
String har = TempData.peek(“name”).Tostring();
}
9. ADVANTAGES OF ASP.NET MVC
Complete control on HTML, css and JavaScript.
Provides clean separation of concerns(SoC).
Search Engine Optimization (SEO) Friendly.
Enables Test Driven Development(TDD).
10. Any web application has two main execution steps, first
understanding the request and depending on the type of the request
sending out appropriate response.
MVC application life cycle is not different it has two main phases, first
creating the request object and second sending our response to the
browser.
MVC Life Cycle