Please enable JavaScript.
Coggle requires JavaScript to display documents.
ASP.NET MVC (Common (LINQ (query syntax, dot-notation syntax, Deferred…
ASP.NET MVC
-
-
-
-
-
-
-
-
-
-
Tempdata/ViewData/ViewBag/Session
ViewBag(in request -> redirecttoaction can not use ViewBag) => can TempData or Session
- Create a Controller
(IController or base Controller)
controller: action, result, filters
- extract from a set of context objects
(Req, Res, RouteData, HttpContext, Server)
- passed as parameters to action method
(value providers and model providers)
- Explicitly invoke the fw's model binding feature
- Gen a response from (IController)
use the HttpResponse context object
- Gen a response from base Controller
(use an action result)
- Tell the MVC Fw to render a view
(Use a ViewResult)
- Pass data from the controller to the view
(Use a view model object or view bag)
-
- Redirect the browser to a new URL
(Use Redirect or RedirectPermanent)
- Redirect the browser to a URL generated by a route
(Use RedirectToRoute, RedirectToRoutePermanent)
- Redirect the browser to another action method
(Use the RedirectToAction)
Use Temp Data for redirection DIFF Session
- TempData: delete after read, are removed when the request has been processed
- Send an HTTP result code to the browser
(HttpStatusCodeResult or 1 of some eg: HttpNotFound)
-
HTML Helper
-
TextBoxFor (input, type=text)(lambda exp)
-
-
Model Binding(Parse Income Data to Property of Domain Object) => Opposite to Html Helper [Request.Form[] and Request.QueryString[]]
-
View Engines (ASPX, Razor, 3rdParty)
-
-
- Smart UI (WinForm, WebForm)
Small/Quick/Demo
-
- Three-Tier Architectures (n-tier)
-
-
-
domain model (real-world entity,
exist in the industry)
-
Mock Objects
It.[Is<T>(); IsAny<T>(); IsInrange<T>(min, max, kind); IsRegex(expr)
-
-
-
-
-
- Local & Call Stack windows
-
-
-
Incoming
convention-based routing
- segment variables {}
(RouteData.Values)
- Static Segments & Mix Segment
-
- define custom segment variables
-
-
-
-
outgoing
- generate <a> element with Html.ActionLink
1st. find in values you pass (object)
2nd. variables values of current req
3rd. default value in route
- provide values for segment variables
- /Home/CustomVariable/Hello
2 /Home/CustomVariable?id=Hello
- define attribute for <a> element
-
- generate URL without <a> element by Url.Action
-
- generate URL from specify route
-
-
- custom URL matching & generation policy
(RouteBase)
-
- Custom mapping between URL and Action
(implement IRouteHandler)
- Break app to section
(create area or RouteArea attr)
- Controller Ambiguity in areas
- prevent IIS and ASP.NET processing request for static files before they are passed to routing system. (route.RouteExistingFile)
By default, the routing system checks to see if a URL matches a disk file before evaluating the application’s routes,
which is why I didn’t have to add a route to get the result
- Prevent Routing system to process a request
(IgnoreRoute method)
-
-
-