Category "asp.net-core-mvc"

Insert data in a table from another model In .NET Core MVC

I'm trying to build a quiz application and i want to insert the user's answers after the quiz is submitted. this is my question model: public class Question {

How to show a partial view in the DOM, from a data obtained from a select control

I am working on a Net Core 5 MVC project. I want to generate a warehouse receipt document from a purchase order, the idea is to show the available orders in the

Bootstrap Modal inside a table populated from a partial

This is follow up question on this (Bootstrap Modal Confirmation using ASP.Net MVC and a table) Using MVC .NetCore, I populate a "partial" view and a Table (cal

Building Offline capabilites in ASP.NET Core web application

We are building a project management web application using those main technologies:- ASP.NET Core MVC SQL Server + Entity Framework HTML, CSS & Bootstrap Th

How to get attribute of dynamically generated element ASP.NET

I know there are tons of questions on this topic and I've tried many of them to no avail. If anyone has any suggestions, it would be greatly appreciated. I'm tr

ASP.NET Core 5.0 MVC : CS1061 error using Html.RenderAction

I am working on a project using ASP.NET Core 5.0 to build a web app (MVC). I tried to use the Html.RenderAction extension method but I get the following error.

Running a method on timer for the life of Session

I use the following code segmant to authenticate my users to office365 for my organization and create a session cookie. This also allows me to start an SMTP con

Link the selected item of drop down list to sql script with an on change event

I have been battling this for some time now without success. So Your help is extremely appreciated. I have created a dropdown list from sql database. What I wan

How to custom 'format' an int in ASP.NET MVC Core?

I have a primary key AccountNumber which is INT. I want it to be displayed in my View like this: 123-456-78. How can I add '-' character between the numbers? Th

Custom authentication with two ADs in ASP.NET Core

I have an ASP.NET Core 5 app that uses the Identity framework on a Windows server. When the user clicks Submit on the Login page, it needs to Authenticate their

RedirecToAction doesnt call the expected view

I have successfully created a product but the page doesn't redirects to the view I want...and I don't really know why... [HttpPost] public async Task AddProduct

ASP.NET Core MVC. Implementation of the IDataProtectionKeyContext interface

There is a data context: public class OurDbContext : DbContext, IOurDbContext, IDataProtectionKeyContext { public DbSet<Employee> Employees { get; set

Display Multiple Tables In A Single View In ASP.NET Core MVC

I'm working on building a website in ASP.NET Core MVC (the latest version). I have Animals table and Categories table,looking like this: On my AdminController

Read action parameters from JSON properties

How can I get the parameters of an ASP.NET Core MVC controller action from the properties of a JSON object that was sent in the HTTP request body? If the reques

how to send array to API which contains image and other data in .net core

When I am passing a single object like below then it is working as per below image [HttpPost] public async Task<ActionResult> Post([FromForm] MyModel Deta

Use the ValidateAntiForgeryToken attribute with JSON POST data

Some of my controller methods have the [ValidateAntiForgeryToken] attribute for the usual reasons. It's only app-internal actions, no cross-site API or similar.

Async Method returns 404

I got the following problem. in my Controller, this method is supposed to return a JSON with the pets from the database. but is being called, the server returns

submit large form data with post action return 400 error in .NET 6

I'm using .NET 6 to post a form with large form data (about 200Mb), and there is no any file. this's kind of my form in front-end: @using (Html.BeginForm(FormMe

Adding dynamically a DbSet<TEntity> in DbContext class

Is there a way to add DbSet<TEntity> Property in DbContext class at runtime without passing through OnModelCreating ?

What does it mean when saying "passing in something" in the following?| ASP.NET Core

I was reading a book about Learning ASP.NET Core API when I run to a part saying: We call GetCommandByID on our repository passing in the Id from our route, st