ASP.Net Object is set back to null after OnGet() method

I build a shopping website and I encountered this error when I tried to post some data.The weird thing is the object apparently is null, even though, I can place the product’s name,price,photo and quantity on the page.I have a product class and a product model class which contains a list of products.In the product model class constructor I create the list with the products that I want to display on the site.Anyway, I have the “Clothing” page which has a list of “Product” objects and it uses the ProductModel class to access the product list which has all the data regarding the products that I want to display.When I used a breakpoint to check if the products are sent to the “Clothing” page, I found out that the Product list is null.

ASP.NET Core Identity registration XSRF/CSRF protection

I’m learning asp.net core 3.1 with Razor pages. While watching tutorials on identity/authentication/authorization, a common example approach for user creation/registration form is to wrap some IsAdmin checkbox or user role selection dropdown box inside a @if(User.IsInRole(...)) block, to be bound and checked later in post handlers. This makes such that regular users can register as guests/customers etc, while admins can create other admin roles.