17. HTTP Request Flow HTTP Response GET /Home/Index HTTP/1.1 HTTP Request Route Handler Controller Model View
18. HTTP Request Flow public class Global : HttpApplication { protected void Application_Start( object sender, EventArgs e) { RouteTable .Routes.Add( new Route { Url = "[controller]/[action]/[id]" , Defaults = new { action = "Index" , id = ( string ) null }, RouteHandler = typeof ( MvcRouteHandler ) }); } } HTTP Response Route Handler HTTP Request Controller Model View
19. HTTP Request Flow public class HomeController : Controller { [ ControllerAction ] public void Index() { CompanyInfo companyInfo = new CompanyInfo (); companyInfo.CompanyName = "Your company name here" ; RenderView( "Index" , companyInfo); } } HTTP Response Controller HTTP Request Route Handler Model View
20. HTTP Request Flow public class CompanyInfo { public string CompanyName { get ; set ; } } HTTP Response Model HTTP Request Route Handler Controller View
21. HTTP Request Flow public partial class Index : ViewPage < CompanyInfo > { } Response View <% @ Page Language ="C#" AutoEventWireup ="true" CodeBehind ="Index.aspx.cs" Inherits ="MvcApplication.Views.Home.Index" %> < html > < head > < title > <%= this.ViewData.companyName %> </ title > </ head > < body > <%= Html.ActionLink( “Homepage" , "Index" , "Home" ) %> < div > Welcome! </ div > </ body > </ html > HTTP Request Route Handler Controller Model
22. HTTP Request Flow HTTP/1.1 200 OK Content-Type: text/html <html> <head> <title>Your company name here</title> </head> <body> <a href="/Home/Index">Index</a> <div>Welcome!</div> </body> </html> HTTP Request Route Handler Controller Model View HTTP Response
23. Wiki A wiki is software that allows users to create, edit, and link web pages easily