diff --git a/tech/C-sharp.wiki b/tech/C-sharp.wiki index dacf08c..08ed713 100644 --- a/tech/C-sharp.wiki +++ b/tech/C-sharp.wiki @@ -145,8 +145,7 @@ class Application == ASP.NET == -See [[asp.net.wiki]] - +See [[asp.net.wiki|ASP.NET]] [[index]] diff --git a/tech/MVC.wiki b/tech/MVC.wiki new file mode 100644 index 0000000..df566ff --- /dev/null +++ b/tech/MVC.wiki @@ -0,0 +1,14 @@ += MVC = + +MVC or model view controller is a programming paradigm where the aspects of +interacting with an application are broken down into + +* Models, or class objects that store data to be manipluated +* Controllers, or classes that serve pages and handle most of the business + logic +* Views, or descriptions/code that creats a user interface. Generally takes a + Model or ViewModel (A class object used just for showing the data) and + displays it, such as html/css + +The MVC model is a great way to break down the mental load of developing a +complex application diff --git a/tech/Ranger.wiki b/tech/Ranger.wiki index 49fb8f8..ea96b07 100644 --- a/tech/Ranger.wiki +++ b/tech/Ranger.wiki @@ -11,3 +11,6 @@ comparment fusebox, and one above the driver's footwell. The rear lamp covers are held on by two screws on the inside of the bed, hidden when the tailgate is up. The other two are on the outside of the truck. + +The main break lamp is a 3457K lamp, often sold as a 3457 lamp. They go for +about 5 dollars. diff --git a/tech/asp.net.wiki b/tech/asp.net.wiki index 705810f..1518192 100644 --- a/tech/asp.net.wiki +++ b/tech/asp.net.wiki @@ -1,3 +1,47 @@ == ASP.NET == ASP.NET is an open source cross platform web framework for C# + +== [[MVC]] == + +See [[MVC]] as a concept. + +The MVC model as it pertains to ASP.NET is very straightforward. There are +Models, which consist of objects, gernerally in the APPNAME.Models namespace. +Next there are Controllers, which are classes with methods for each operations +on the site (IE view/create), etc. + + +== Site structure == + +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()` + +== Views == + +A cshtml block may be created using a `@{}` block. Here C# can be placed, +however it is always ran by an interpretter at runtime, and is therefore not +recomended often. + +=== Passing data to views === + +A view can take paramaters, primarily a single object, via passing it to the +`View()` constructor. In the .cshtml file (the view), one must then add the +line `@model APPNAME.Models.SomeModel` to specify the exact model type being +passed in. + +NOTE: `@using APPNAME.Models` is required at the top of the view + +=== Showing Controller data in views === + +A view can display data from a passed model via the `@Model.MEMBER_VALUE` +syntax anywhere in the HTML. + +=== ViewBag === + +The ViewBag is an object that can be accessed in the Controller, and any sub +type can be apecified. IE `ViewBag.Title = "Some title"` is valid, without +declaring Title as a string or even existing first.