From fa59416737d5b6ad04ae63427762b7e78a7e9c4f Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Wed, 23 Feb 2022 15:00:01 -0500 Subject: [PATCH] Update for 23-02-22 15:00 --- tech/asp.net.wiki | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 ==