diff --git a/tech/asp.net.wiki b/tech/asp.net.wiki index 1518192..5d95f91 100644 --- a/tech/asp.net.wiki +++ b/tech/asp.net.wiki @@ -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 ==