Questions tagged [asp.net-core-mvc]

ASP.NET Core MVC is a lightweight presentation framework for creating dynamic websites with ASP.NET Core. It allows for creating controller based MVC sites, or view model based Razor pages. MVC includes features like routing, model binding and validation, filters, web APIs and the Razor view engine.

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

How to fix Repeated Storing Data to DB table using C#

I am struggling to prevent the data from repeating in my db table, even chat gpt keeps on repeating the solution. here is the code from visual studio var premArrearsGet = await _autoLISContext....
Cyrus Yabut's user avatar
0 votes
1 answer
35 views

ASP.NET Core MVC: Passing one parameter from a view to a controller

I have my Regions Index here that passes the regionID for a region through as an asp-route-id that is meant to go to this URL when the link is clicked (which it does): /Countries/Index/{id?} @model ...
softloftmaria's user avatar
0 votes
1 answer
20 views

How to revert to code from publish file ASP.NET Core MVC

I published an ASP.NET Core MVC app to hosting four months ago. Now, I need to make some changes, but I've lost my source code, and the Git version is too old. However, I do have access to the last ...
rikobgrff's user avatar
0 votes
0 answers
23 views

Download directly the view returned from controller in ASP.NET Core 3.1 MVC

Upon filling a form, and clicking download button it calls the following controller. public async Task<IActionResult> InvigilatorDiaryPrint(InvigilatorDiaryDTO invigilatorDiaryDTO) { var ...
Athulya P D's user avatar
0 votes
1 answer
49 views

Issue with NuGet - Cannot download package from nuget in ASP.NET Core MVC

I'm new to Visual Studio 2022 and ASP.NET Core. I have an issue with nuget package. When I'm starting a new project using ASP.NET Core Web App (Model-View-Controller) and Individual Accounts ...
muntun's user avatar
  • 41
0 votes
1 answer
34 views

Create Form Razor Page with Nested Models

I have a razor page create form. The model it accepts is a NewHireClassModel: public class NewHireClassModel { public int new_hire_class_id { get; set; } public int district_id { get; set; } ...
Tristen Hannah's user avatar
0 votes
2 answers
52 views

Connect the view of different name to a HttpGet method in controller

The code is pretty simple. I have a controller called Contact that has a method ReviewAddContactPage (HttpGet): namespace ContactPageWeb.Controllers { public class ContactController : Controller ...
Calvin M.'s user avatar
0 votes
1 answer
12 views

Checkbox values not returning to controller ASP.NET Core 7 MVC

In my model, I have a person defined as public class Person { [Key] public int Id { get; set; } public string Name { get; set; } public bool IsSelected { get; set; } = ...
Currie Dail's user avatar
0 votes
1 answer
25 views

.NET Core web application with Popup modal. Can it move off screen to a new screen?

I have a .NET Core 5 web application. Client side I am currently using Bootstrap modals. I have a partial view that is just a button and when clicked we open a bootstrap modal. So my users want this ...
SapphireGirl's user avatar
0 votes
1 answer
71 views

Deployment status shows deployment successful, but last deployed displays nothing in Azure CLI

My application has a .NET Core 7 backend and it uses a SQL database. I'm trying to deploy it onto an Azure App service (Windows platform) using the Azure CLI, but I have not had any luck so far. I'm ...
nimramubashir's user avatar
1 vote
2 answers
42 views

LogTrace and LogDebug Not Appearing in Console OR Debug Windows - Logging issue in .NET 7.0

I am managing to display logging for the following Level of logs in both the console and debug windows in my ASP.NET Core 7 MVC project. .LogInformation .LogWarning .LogError .LogCritical However, ...
Spedward's user avatar
0 votes
0 answers
25 views

I can't send data view to controller in ASP.NET Core MVC project

That is my view: @model DBYTest.Models.TblDebitEnter @{ ViewData["Title"] = "Debit Register"; } <!DOCTYPE html> <html> <head> <meta charset="utf-...
Mete Sert's user avatar
1 vote
0 answers
26 views

How to Handle Cookie Expiration in Asp.Net Core 7?

I'm new to Authentication using Cookies and Claims. So i have followed the offical Microsoft Documentaion on how to apply authentication in an Asp.Net Core 7 Application. https://learn.microsoft.com/...
Bola Adel Nassif's user avatar
0 votes
0 answers
28 views

Visual Studio publish error "Failed to determine the https port for redirect"

I'm trying to connect my database using API by using Microsoft.EntityFrameworkCore Microsoft.AspNetCore.OpenApi Microsoft.EntityFrameworkCore.Tool MySql.EntityFrameworkCore Swashbukle.AspNetCore ...
Zaid's user avatar
  • 1
0 votes
0 answers
27 views

How to call the IApplicationBuilder object in ASP.NET Core controller

I am new to ASP.NET Core, and I am now building a ASP.NET Core MVC app that requests data from another API using authentication bearer header. I am following this tutorial. But I am confused where ...
Ibrahim Memet's user avatar
1 vote
0 answers
14 views

Web socket request gets garbage collected while in use

I have the following ASP.NET Core MVC controller action. It is stripped of most real code. [Route("ws")] public async Task WebSocket() { using (var data = new Data()) { if (...
maloo's user avatar
  • 705
1 vote
2 answers
45 views

How does WebApplication.CreateBuilder().Services.AddTransient() work in ASP.NET Core MVC?

I'm using an ASP.NET Core MVC web application. I have a model called District: public class DistrictModel { public int district_id { get; set; } public string district_name { get; set; } } I ...
Tristen Hannah's user avatar
1 vote
2 answers
59 views

How to redirect to a specific web page after sign out from Entra ID

I've got an ASP.NET Core MVC application that implements Microsoft.Identity.Web.UI nuget package for authentication against Microsoft Entra ID (formerly Azure Active Directory). The necessary App ...
Carl Heinrich Hancke's user avatar
0 votes
1 answer
41 views

ASP.NET 6 input validation: unique column on create - but validation problem on update

I have a table with key Id, and have a unique column (Name). When creating a new row, the Name must be unique. I created a custom validator. public class UniqueNameValidationAttribute : ...
Sandor.Oros's user avatar
0 votes
0 answers
23 views

ASP.NET Core MVC : when partial view script

In ASP.NET Core MVC, when I used a partial view and add dynamic Javascript event to it using the document.addEvenetListner, the event is not working. Parent View -vWHosiptalGeneralScrning.cshtml ...
Umer Ullah's user avatar
0 votes
1 answer
49 views

Run ASP.NET Core 6 MVC app with attribute route

I have an ASP.NET Core 6 MVC application and when I run my app, I get a http 404 error: Index action method: public class HomeController : Controller { [HttpGet] [Route("/User/Dashboard&...
tachafine ammel's user avatar
1 vote
1 answer
43 views

ASP.NET Core MVC: get token to call downstream API: Can't resolve service for type 'Microsoft.Identity.Abstractions.IAuthorizationHeaderProvider'

I am following this tutorial from MSFT: https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-call-api-acquire-token?tabs=aspnetcore Based on the following code I should be ...
Kyle Barnes's user avatar
0 votes
0 answers
18 views

Issues with IIS formatting and loading Resources in ASP.NET Core MVC [duplicate]

I'm creating an ASP.NET Core MVC web application and I'm trying to launch it in IIS. Now when I launch it in visual studio it displays fine, but when I try to browse it in IIS I experience issues with ...
caitlin wardle's user avatar
0 votes
3 answers
82 views

How to directly display login screen on welcome/start page in ASP.NET Core 6 MVC app?

I work on my first project, app based on ASP.NET Core 6 MVC with default identity Razor pages. I'm working on .NET 6 and using EF Core 6. The app is a customer management system and it's for internal ...
kkkristo's user avatar
1 vote
1 answer
34 views

Login functionality is not working when the IP Address of the server was bind to the Website in IIS

What could be causing the login function in an ASP.NET Core MVC Web App, as depicted in the provided code, to experience issues when binding the application to a specific IP address in IIS? ...
mat mat's user avatar
  • 13
0 votes
0 answers
53 views

Run Visual Studio template Azure AD authenticated ASP.NET Core MVC application in Docker

I have created an AzureAD authenticated ASP.NET Core MVC application using the Visual Studio template. For testing I would like to run the application in my local Docker instance. After using the ...
Kyle Barnes's user avatar
0 votes
0 answers
58 views

Product Not Found

I am following an instructor, I get an error like this during adding products to the cart of the application he made, when I checked my Service layers and Repo layers, I did not see a problem, could ...
Mehmet's user avatar
  • 23
-1 votes
1 answer
51 views

ASP.NET Core MVC : fill data from SQL Server function into model

I looked for a lot of training materials, but I couldn't find any real example for a database first approach when creating a simple CRUD web application in ASP.NET Core MVC. In real life your database ...
PKa's user avatar
  • 11
0 votes
0 answers
27 views

DataGrid In devextreme ASP.NET Core MVC

I have an ASP.NET Core MVC project with devextreme and I added a datagrid. I want to modify this column in datagrid to be list of button, in selectBox I want items in it to be Button not pure text. ...
Altan's user avatar
  • 1
-2 votes
1 answer
58 views

I want to remove validation in ASP.NET Core 6

I have a model class User and I want to remove the validation well [ValidateNever] attribute does not work. Model class User: public class User { [Key] public int Id { get; set; } [...
Bilal Khan's user avatar
0 votes
1 answer
76 views

Why the identity implementation in .NET 7 has errors [duplicate]

I want to create a .NET 7 project with clean architecture(JasonTaylor) When I run the program, I get this error: Some services are not able to be constructed (Error while validating the service ...
movahedijam's user avatar
0 votes
2 answers
59 views

Pass table row textbox values from View to Controller in ASP.net MVC Core

<form method="post" asp-controller="ctrName" asp-action="Index" > <input type="text" class="form-control > &...
Kamini Singh's user avatar
1 vote
1 answer
44 views

ASP.NET Core MVC : Okta integration

I'm creating an ASP.NET Core MVC application which uses Okta for authentication. I'm experiencing a very strange issue. My Okta sandbox works great, but when I switch to my Okta Production I get the ...
caitlin wardle's user avatar
0 votes
0 answers
50 views

ASP.NET Core: values not passed to action method correctly

I am working on an ASP.NET Core application, and I am encountering an issue where the values from a form in a Razor view are not being passed correctly to an action method. Specifically, I have a ...
Windows 2000's user avatar
0 votes
1 answer
19 views

IUrlHelper seems null when instantiate controller from Test case

Inside a controller action i have public async Task Delete() { var redirectUrl = Url.Action( action: "Test", ...
pikk's user avatar
  • 827
0 votes
1 answer
108 views

How to create custom range sliders with min and max using CSS and JavaScript

I have a requirement to have a range slider with min and max and 2 textboxes to show those selected values in the given design of the range slider. I tried to refer below links. https://jsfiddle.net/...
Limna's user avatar
  • 19
-1 votes
1 answer
21 views

ASP MVC Core architecture for multiple client SAP integrations

A little bit of context: We currently have a monolith application with an .NET ASP NET MVC Core architecture using CQRS & EF Core to 1 big SQL database. This cloud solution can be accessed by ...
Yan's user avatar
  • 405
0 votes
1 answer
55 views

ASP.NET Core MVC Google Authentication Token

I'm using ASP.NET Core 7.0 MVC. I have followed https://learn.microsoft.com/aspnet/core/security/authentication/social/google-logins to set up my google login: WebApplicationBuilder ...
Sunny Leu's user avatar
0 votes
2 answers
92 views

.NET Core Controller Run Dapper Query and write to a file in background

Our use case requires huge processing of data extraction and writing to a file to be further processed by other processors. Due to the fact that there is a lot of data involved, it's impossible for ...
ajaloha's user avatar
0 votes
1 answer
32 views

EF Migration CLI creates incorrect column data types

In part 4 of the ASP.NET Core MVC tutorial for Visual Studio code, the EF migrations cli command of dotnet ef migrations add InitialCreate is producing a migration file with incorrect column data ...
Nicursus's user avatar
0 votes
3 answers
54 views

How to refresh data displayed in ViewComponent's default View : ASP.NET MVC Core

I have a razor view that is divided into two columns. The column on the left contains a list of bootstrap list-group-items ( job cards). On the right is a larger column to display the full details of ...
emile keen's user avatar
0 votes
1 answer
35 views

Trying to Add New Scaffolded Item

I am using Visual Studio 2022 and creating new Asp.net Core MVC application using dotnet Core 6.0 framework and following nuget packages: Microsoft.EntityFrameworkCore.Design 6.0 Microsoft....
Gurdeep's user avatar
0 votes
1 answer
28 views

How can I secure the views in ASP.NET Core 6 MVC app with external jwt authentication

I am new to ASP.NET Core 6 MVC and I'm working on a small project where users can: Sign In (form is sent to an external API which returns a JWT token) View pages but only after authentication. The ...
A Gilani's user avatar
  • 427
0 votes
1 answer
29 views

IIS not displaying partial pages for ASP.NET Core MVC web application

I have an ASP.NET Core MVC web application that I'm trying to host in IIS (as a nested application). The problem is that when I run a page that has a partial view (a list object that displays a table),...
caitlin wardle's user avatar
0 votes
2 answers
43 views

No code generators found with the name 'view'

I have an ASP.NET Core 6 MVC web app, and using VS 2022. It's a simple web store project with a few products listed and shopping cart added. The web site works, I can see products, details, pictures ...
mer063's user avatar
  • 47
0 votes
1 answer
64 views

ASP.NET Core 6 MVC redirect the users to subdomain based on Azure AD group

I am trying to write an ASP.NET Core 6 MVC controller method in C# that will redirect the Azure AD authenticated user to the subdomain based on Azure AD group assigned to the user. Can any expert ...
Mic's user avatar
  • 111
1 vote
1 answer
44 views

ASP.NET Core MVC not working when published to IIS, particularly Okta integration

ASP.NET Core MVC web application that I'm trying to publish and deploy to IIS. My application uses Okta as a authorization. It works perfectly when run from VS code but when I publish it and create ...
caitlin wardle's user avatar
-1 votes
0 answers
43 views

Not sure why my form isn't saving down correctly in ASP.NET Core

registration controller using GLOS.Data; using GLOS.Model; using Microsoft.AspNetCore.Mvc; namespace GLOS.Controllers { public class RegistrationController : Controller { private ...
Randy's user avatar
  • 1
0 votes
0 answers
40 views

How to run my ASP.NET Core 6 project using any 6.x.x .NET installed version

I'm mantaining a bundle of projects with ASP.NET Core 6, about 100 of them and increasing, and I usually have to open it, run it, check stuff, modify stuff, etc. Projects were created by the same ...
Windgate's user avatar
  • 364
0 votes
0 answers
32 views

Integrate Blazor components with Sdk Microsoft.Net.Sdk in the project type "class library"

Is it possible to integrate Blazor components in the Microsoft.Net.Sdk, class library project. Target: net7.0. It is a custom plugin in Nocommerce framework. if I try with the new MVC Web project (...
Lena's user avatar
  • 15

1
2 3 4 5
287