how to pass list of object from view to controller in asp.net mvc
first i create list of models in [HttpGet] action and return to view.
first i create list of models in [HttpGet] action and return to view.
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.
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.
I have a ASP.NET Core razor page and model that uses query strings to filter search results and paging via GET.
For my app I need something like database of online users. I want to add user to database by OnGet() function. When user leave site his data should be deleted from database. I search for some event or whatewer which can run my deleting function. I´m sorry for my english and possibly wrong formulated question. Thanks for reply.
I have a JavaScript function that creates a fading slideshow. It uses images in the directory:
I am wondering if is there any difference of [Authorize] attribute and AuthorizePage(string) method in ASP.NET Core? Project uses ASP.NET Core 3.1. Is there any advantage or disadvantage using one?
I am using the new Razor Pages in ASP.Net core 2
Now I need to redirect
Learning new things needs an investment of time, space and energy. I am currently learning Asp.Net Core MVC 2.0. This ASP.NET Core tutorials overview states: