Posts

Showing posts from July, 2020

ASP NET Core 3 1 State Management With Hidden fields - Part 15

Image
Visit this channel community tab: https://www.youtube.com/c/KaushikRoyChowdhury-deveducate/community for latest releases and updates Prev. Part: https://youtu.be/7xDgQGH-MYs This is part 15 of the ongoing playlist of ASP.NET Core 3.1 lectures. In this lecture, we understand the concept of hidden fields in State Management through an MVC UserDetails controller. The project uses two action methods one with GET to set the hidden fields to the client which is visible in page source. The PUT action method posts the hidden field to the server and tested in a debugging session with breakpoints. #aspnetcore31 #hiddenfields #statemanagement #persistdataacrossrequests #aspnetcoremvc

ASP NET Core 3 1 State Management With Hidden fields - Part 15

Image
Visit this channel community tab: https://www.youtube.com/c/KaushikRoyChowdhury-deveducate/community for latest releases and updates Prev. Part: https://youtu.be/7xDgQGH-MYs This is part 15 of the ongoing playlist of ASP.NET Core 3.1 lectures. In this lecture, we understand the concept of hidden fields in State Management through an MVC UserDetails controller. The project uses two action methods one with GET to set the hidden fields to the client which is visible in page source. The PUT action method posts the hidden field to the server and tested in a debugging session with breakpoints. #aspnetcore31 #hiddenfields #statemanagement #persistdataacrossrequests #aspnetcoremvc

ASP NET Core 3 1 Uderstand State Management With QueryString with an MVC...

Image
This is part 14 of the ongoing playlist of ASP.NET Core 3.1 lectures. In this lecture, we understand the concept of Querystring in State Management through an MVC UserDetails controller. URL Query String is used to pass parameters to the action method in the userdetails controller which uses the passed in parameters to assign the properties to the employee class. #aspnetcore31 #querystring #statemanagement #persistdataacrossrequests #aspnetcoremvc

ASP NET Core 3 1 Understand State Management With Sessions with an MVC A...

Image
This is part 13 of the ongoing playlist of ASP.NET Core 3.1 lectures. In this lecture, we understand the concept of Sessions in State Management through an MVC UserDetails controller. The controller sets the sessions in the Index action method and retrieves the values in a Get() action method. Session state is used for storing user data as the user navigates through a web app. It uses a store maintained by the app to persist data across requests from a client. Session data is backed by a cache and is considered temporary (or transitory) data. Critical application data should be stored in the user database so that site should continue to function without the session data. #aspnetcore31 #sessions #statemanagement #persistdataacrossrequests #aspnetcoremvc

ASP NET Core 3 1 State Management With Cookies - Part 12

Image
This is part 12 of the current playlist on ASP.NET Core 3.1 lecture videos. In this part, we walk through creating an ASP.NET Core 3.1 MVC application from scratch to show how the cookies are persisting data in between the trip to the server and back and how the cookies can be deleted by calling an appropriate method on the cookie object. Cookies are one of several methods employed in State Management in ASP.Net Core 3.1 #aspnetcore31 #cookies #statemanagement #aspnetcore31mvc #cookieauthentication Code: (HomeController.cs) public class HomeController : Controller     {         public IActionResult Index()         {             string Name = Request.Cookies["Name"];             return View("Index", Name);         }         [HttpPost]         public IActionResult Index(IFormCollection form)         {             string Name = form["Name"].ToString();             CookieOptions options = new CookieOptions();             options.Expires = DateTime.Now.AddMin

ASP NET Core 3 1 Build a Complete MVC ToDo List Application Part 11

Image
This is part 11 of the current playlist of ASP.NET Core 3.1 lecture videos. In this lecture we will: Walkthrough building the same todo list application with ASP.NET Core MVC that we built using Razor Pages (Part 10). Along the way, we shall note the difference in the approaches in building the same application in two different ways. We shall make use of the same ToDo list model and the ToDoService class. However, the additional steps of creating a suitable view model to render a view with the data we want are explained. The controller and the Category action model have been explained and the changes to the Service class (to make it more scalable) have been shown in code. The conventional and attribute routing to show the todo view have been discussed. The analogy of MVC Controller and action method with the Razor PageModel class and the Page Handler method have been brought to light.  #ASPNETCORE31 #RazorPage #MVCDesignPattern #todolistappmvc #MVCController #Routing #ActionMethod

ASP NET Core 3 1 Build a Simple Razor Pages ToDo Application Part 10

Image
Code: Category.cshtml @page @model ASPNETCoreWebApplication.Pages.CategoryModel @{     Layout = null; } <!DOCTYPE html> <html> <head>     <meta name="viewport" content="width=device-width" />     <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />     <title>Category</title> </head> <body>     @foreach (var item in Model.Items)     {         <div class="bg-light card card-text font-weight-bolder font-italic"> ToDoItem : @item.Name</div> <br />     } </body> </html> Category.cshtml.cs: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ASPNETCoreWebApplication.Model; using ASPNETCoreWebApplication.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace ASPNETCoreWebApplication.Pages {     public class Cate

ASP NET Core 3 1 Combining Middleware in a Pipeline - Part 9(a)

Image
This lecture discusses two simple cases of a middleware pipeline using the 1) WelcomePage 2) Static files middleware. The lecture video then goes on to combine some more middleware in the pipeline and brings the explanation of the response generated to a given HTTP request. It brings out the salient points of this middleware pipeline: • Each middleware component in a pipeline generally addresses a single function • It handles only one function of a request • For example, the logging middleware deals with logging the request, Static file middleware only deals with returning static files in the request • This means we are not forced into having authentication or image resizing behavior in a static file middleware for which there are additional pieces of middleware • As shown in the previous lecture, to build a complete application, multiple middleware are composed together that form a pipeline. • Each middleware has access to the original request as well as any changes made to the

ASP NET Core 3 1 Create a Custom Middleware

Image
In this part, we discuss the way a custom middleware is built as an inline middleware using request delegate. This lecture shows the use of an anonymous method to create a chain of simple request delegates with httpcontext object together with Use extension method. The next parameter represents the next delegate in the pipeline. You can short-circuit the pipeline by not calling the next parameter. #aspnetcore31 #chainrequestdelegates #inlinemiddleware #anonymousmethod #requestpipeline

ASP.NET Core 3.1 Request Delegate in Code as Inline Middleware - Part 8

Image
This is part 8 of the playlist on ASP.NET Core 3.1 videos. This tutorial discusses the basic request delegate as inline middleware. It shows in C# code an inline request pipeline consisting of two chained custom inline middleware components. #aspnetcore31 #requestdelegate #middlewarepipeline #inlinemiddleware #requestpipelineaspnetcore

ASP.NET Core 3.1 Concepts and Use Cases of Middleware Pipeline - Part 7

Image
This is part 7 of the playlist. This tutorial discusses what middleware and middleware pipeline are all about. It brings up some key points about the middleware in the request-response scheme of things. The lecture discusses that middleware is a C# class that accomplishes a functionality for an asp.net core 3.1 application. There are examples like logging, image resizing, authentication, authorization, routing, and many other middleware that are already built into the ASP.NET Core web framework. A middleware is termed a terminal middleware if it short circuits the rest of the middleware downstream and returns a response to the specific request which reverses the direction of flow. Also, the endpoint middleware is perhaps the most important of all the middleware as if the request reaches this middleware an html or web api response is generated by it and sent back to the ASP.NET core server. So all the html or web api responses are generated by endpoint middleware. Also one piece of

ASP.NET Core 3.1 Concepts and Use Cases of Middleware Pipeline - Part 7

Image
This is part 7 of the playlist. This tutorial discusses what middleware and middleware pipeline are all about. It brings up some key points about the middleware in the request-response scheme of things. The lecture discusses that middleware is a C# class that accomplishes a functionality for an asp.net core 3.1 application. There are examples like logging, image resizing, authentication, authorization, routing, and many other middleware that are already built into the ASP.NET Core web framework. A middleware is termed a terminal middleware if it short circuits the rest of the middleware downstream and returns a response to the specific request which reverses the direction of flow. Also, the endpoint middleware is perhaps the most important of all the middleware as if the request reaches this middleware an html or web api response is generated by it and sent back to the ASP.NET core server. So all the html or web api responses are generated by endpoint middleware. Also one piece of

ASP.NET Core 3.1 - How Razor Pages Generate Response Part 5

Image