Update for 23-02-22 15:00
This commit is contained in:
parent
d2fa17e9ea
commit
fa59416737
@ -18,7 +18,28 @@ For some controller, XYZController, the base, or Index() of the controller, can
|
||||
be accessed via mysite.com/XYZ. For other methods on the site, such as create, one must call
|
||||
mysite.com/XYZ/Create. This applies for all methods in the Controller class
|
||||
following signature `public IActionResult MyCustomMethod()`. These usually
|
||||
end with a `return View()`
|
||||
end with a `return View()`. These methods are called Actions or Action Methods.
|
||||
|
||||
== Controllers ==
|
||||
|
||||
=== Return types ===
|
||||
|
||||
* `View()`
|
||||
* Returns the associated view
|
||||
* Can be passed a model for data to be parsed by the view
|
||||
* `RedirectToAction("Index")`
|
||||
* Redirects user to some page
|
||||
* Page is specified via the name of the Function as the Paramater
|
||||
|
||||
=== Action paramaters ===
|
||||
|
||||
Each action can take paramaters. These paramaters are URL paramaters and
|
||||
their names match those sent in the URL. For example,
|
||||
|
||||
`public IActionResult MyAction(string name)` would take the paramater
|
||||
`somesite.xyz/SomeController/MyAction?name=some_name_string`. In the controller,
|
||||
the passed in arguments `name` would hold value `some_name_string` in this
|
||||
instance.
|
||||
|
||||
== Views ==
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user