Questions tagged [asp.net-mvc]
The ASP.NET MVC Framework is an open source web application framework and tooling that implements a version of the model-view-controller (MVC) pattern tailored towards web applications and built upon an ASP.NET technology foundation.
asp.net-mvc
200,668 questions
1
vote
1
answer
55
views
Visual Studio 2026 cshtml pages intellisense not working
My ASP.NET MVC app is building fine still, but since moving to VS 2026 the intellisense is broken. When I hover over the "red squiggles", I get an error
CS0103 message: the name 'model' ...
0
votes
1
answer
43
views
Why does Azure Search return null for the calling method?
I have a web application implementing Azure Search. It is also using interception to build filters for the search prior to execution.
The path of execution is:
controller calls search provider
...
0
votes
1
answer
75
views
ASP.NET MVC pasting document path into a textbox to read recipe XML file by button click
I'm new to ASP.NET MVC and want to create a web-based recipe app. In this app, I want to read XML files from my computer or mobile. For that reason, I want to copy the file location into a text file ...
0
votes
1
answer
87
views
ASP.NET MVC on .NET 4.6 : session and cookies being cleared as soon as RedirectToAction or Redirect is called
I have an ASP.NET MVC web application on .NET 4.6 that works just fine in one environment, but fails in the second, when all configurations are the same. Doing a bit of debugging showed that the ...
0
votes
0
answers
58
views
How to configure equirectangular tile images in photo sphere viewer 360 load
I’m using ASP.NET (.NET Framework) and trying to display an equirectangular tiled panorama using Photo Sphere Viewer v5.14.1 with EquirectangularTilesAdapter.
The ...
1
vote
0
answers
69
views
Implement ASP.NET Core style attribute based routing in ASP.NET MVC?
So I actually implemented it, but there is one last problem I need to resolve.
My implementation can be summarized by these two classes:
Hooking into the ASP.NET MVC startup code to register ...
Best practices
0
votes
1
replies
36
views
Best way to send GTM Server-side or Facebook conversion API events without blocking user requests?
I'm working on a custom e-commerce CMS built on ASP.NET MVC 5. I need to send marketing / analytics events server-side to multiple platforms such as:
Google Tag Manager Server-Side
Facebook ...
0
votes
1
answer
131
views
Task List displaying TODO comments as belonging to auto-generated files
I'm working with Visual Studio 2022 v17.14.23 on my very first Blazor project.
I ran into an unexpected behaviour when leaving a TODO comment in a .razor file: as ...
0
votes
0
answers
48
views
ASP.NET MVC application which uses current logged in user (Windows username) is not providing username after publishing
I have an ASP.NET MVC application which retrieves current logged in user id (Windows login id).
It works in Visual Studio, running with localhost. But after publishing, this value is returned as empty....
1
vote
0
answers
85
views
Cascading dropdowns stop working after rendering form via Ajax in ASP.NET MVC
I have an ASP.NET MVC form with cascading dropdowns (Category -> Sub Category).
Everything works fine when the form is rendered normally in the view.
However, I changed my code to render the form ...
0
votes
1
answer
80
views
Json is not returned to the calling Ajax
I have a form in a partial view. The view receives a "model".
...
0
votes
1
answer
71
views
Business Central custom API page: PATCH 404 on singular endpoint with composite ODataKeyFields
I've created a custom API page in Dynamics 365 Business Central (sandbox environment) for my custom "Warehouse Activity Line" table.
...
0
votes
1
answer
31
views
How to upload "files" and not "blobs" with Filepond - Filename problem
I'm using Filepond to edit an item with its images. The user should be able to modify the images (move, delete, add).
The previously uploaded image files are loaded (from a folder on the server) and ...
1
vote
0
answers
67
views
GoogleAuthenticator (2FA) fails validation on mobile browsers but works on desktop in C# & ASP.NET MVC
I am implementing Two-Factor Authentication in a C# & ASP.NET MVC project using the GoogleAuthenticator NuGet package (v3.2.0).
The issue: the authentication works perfectly on all desktop ...
1
vote
1
answer
144
views
Missing Publish Targets After Migrating ASP.NET MVC .vbproj file to SDK-Style using CZEMacLeod / MSBuild.SDK.SystemWeb
I'm using Visual Studio 2022 17.14.21. I have a VB.Net .NET Framework 4.8 based ASP.NET project that I upgraded to SDK-Style using the "Upgrade Assistant".
After the migration, I manually ...
0
votes
1
answer
79
views
Value cannot be null. Parameter name: provider using DI in .NET framework
I have added Microsoft DependencyInjection nuget to a .NET 4.8 project and used this post to help set it up: https://stackoverflow.com/a/73414927/2739613
My code looks like this - ...
0
votes
0
answers
33
views
Is it possible to achieve Content Security Policy compliance (remove 'unsafe-inline') without migrating inline script block to an external .js file?
In my ASP.NET MVC 5 project, I am migrating to a strict Content Security Policy (CSP) to eliminate the use of 'unsafe-inline' for scripts. While I have successfully ...
Best practices
0
votes
2
replies
87
views
Which ASP.NET MVC structure is better practice for medium-size applications?
From my research, best practice for project structure in ASP.NET seems to vary massively, particularly depending on the size of the application. I found this page from Microsoft: https://learn....
Best practices
0
votes
3
replies
66
views
Add a NotMapped field to my model or create a view model to interface between the model and view?
I come from a MVVM in WPF background moving towards ASP.NET MVC. I have a model that is composed of another model called Message, like so:
...
Advice
0
votes
2
replies
56
views
Deploying ASP.NET API and ASP.NET MVC app on the same IIS default site
I have this scenario: I have an ASP.NET API which is deployed on IIS under the default web site. I have added the API by right click on default web site -> add application. API is working fine and ...
0
votes
0
answers
50
views
Issue with Add Draw Ink And Re Open in PDF Viewer after Modifications in library Syncfusion , Js And Asp.net core mvc
I am experiencing an issue when using Syncfusion PDF Viewer with PDF files after making edits using the Draw Ink tool or any other tools :
I opened a PDF file using PDF Viewer.
I added text using ...
2
votes
1
answer
74
views
Configure SignalR to work in all views. Which view is currently being viewed, in ASP.NET MVC?
I've implemented SignalR as an add-on to a user-to-user messaging system. I use it to notify the recipient that they've received a message.
This works when the recipient is already viewing their ...
0
votes
0
answers
45
views
SustainSys ASP.NET MVC 4.* question - The signature verified correctly with the key contained in the signature, but that key is not trusted
SustainSys has been working for webforms, ASP.NET MVC on .NET 4.8, and ASP.NET Core on one server for a while.
I want to move the apps to some other servers using the same certificate. I was able to ...
0
votes
1
answer
94
views
Database data missing when reading - ASP NET MVC
I'm working on a messaging platform type sales platform. A buyer can contact a seller about a product. Their message concerns a specific product.
The exchange of messages is only possible between a ...
2
votes
2
answers
224
views
How do you add a choicefield dropdown to the form builder connectors settings section in sitefinity using FormsConnectorDefinitionsExtender
I'm trying to add a dropdown to the connectorsSettings section in the form builder using FormsConnectorDefinitionsExtender.
My ...
0
votes
0
answers
50
views
Partial view with pagedlist inside a Tab control
After several days and multiple attempts using examples, I am still struggling to get a partial view to page inside a tab control. In the code below, when selecting the 'tab4' Tab 1st time, it ...
1
vote
2
answers
124
views
Foreign keys are null when retrieved, even though stored correctly in database
I have the following classes in my (code-first) Entity Framework Core database schema:
...
0
votes
0
answers
53
views
TLS issues with ActionMailer.Net [duplicate]
I have an ASP.NET MVC application, that uses the following package
ActionMailer.net
This has been going beautifully for many years, but lately we have been hitting issues with the mail servers we have ...
0
votes
1
answer
117
views
Using [FromQuery] with a .NET controller for an optional boolean query string parameter where presence alone should set it
.NET has [FromQuery] to get query parameters on the path.
For instance my/foo?bar=1 maps to:
...
1
vote
1
answer
122
views
Keycloak supported ASP.net app loops following authentication
My program has recently began support of Keycloak and I have been doing my best to learn it while managing my other tasks. However, I recently came across an issue that I simply can not seem to solve.
...
1
vote
0
answers
72
views
Dockerizing ASP.NET MVC application on .NET 4.5.2 - 404 from ManagedPipelineHandler on hitting an action method
I am trying to dockerize an existing ASP.NET MVC application running on .NET 4.5.2. I am using ...
0
votes
0
answers
80
views
.AspNet.Cookies not set in IIS virtual application when using OWIN cookie middleware with .NET Framework
I'm running a .NET framework 4.7.2 application using OWIN cookie authentication under IIS as a virtual application locally (e.g., https://example.test/cms/) but I end up in and endless redirect loop ...
0
votes
1
answer
152
views
Owin security could not handle callback "signin-oidc", Error 404 on ASP.NET MVC
I have a simple ASP.NET MVC app with .NET 4.8.
I want to use keycloak as security management and my app connect to it via openid connect protocol.
To do this, I've created a ...
1
vote
1
answer
76
views
CSP Violation when including iframe in web page
I have an iframe embedded in an ASP.NET web form. I have included what I thought was the correct Content-Security-Policy values in the web.config.
However, I still ...
0
votes
0
answers
59
views
ASP.NET MVC on .NET 4.7.2 - HTTPS IFrame - The required anti-forgery cookie "__RequestVerificationToken" is not present
Starting yesterday, an ASP.NET MVC web application running on .NET 4.7.2 that is called in an IFrame stopped working with the following error:
The required anti-forgery cookie "...
0
votes
0
answers
57
views
How to configure ASP.NET MVC (.NET 4.8) app to work under /report location with Nginx?
I have an ASP.NET MVC application (on .NET 4.8). Currently, the DevOps team has set up Nginx to handle requests with: location: / and this works fine.
Now they want ...
1
vote
1
answer
154
views
ASP.NET MVC: Anti-forgery token could not be decrypted after 10–15 minutes of idle time
I’m running an ASP.NET MVC application on IIS. The site structure is simple: a single IIS server (not a web farm or cluster) with one site that hosts several applications.
From time to time, I get the ...
0
votes
0
answers
66
views
Debug SessionState using SQL Server connection error
I have an ASP.NET MVC application that is configured to use SQL Server to save the session state. If there is an issue with the session state connection string (invalid password, server, etc) my ...
0
votes
0
answers
75
views
How to fix the 'Generic Padding Oracle' vulnerability when recommended steps fail
I have been scanning our deployed (ASP.NET Framework 4.7.2) applications for vulnerabilities and on one of them have encountered the OWASP warning Generic Padding Oracle. My understanding of this ...
2
votes
1
answer
121
views
Why doesn’t ActionResult<T> work in .NET Azure Functions isolated worker model?
I recently upgraded a .NET Function App from the in-process worker model to the isolated worker model.
After the upgrade, I noticed that none of the HTTP-triggered APIs were returning any data.
On ...
0
votes
1
answer
39
views
Fluent Validation error not firing due to list for comparison being empty
This a continuation of this question: ASP.NET MVC Create View - Where to place ValidationMessage (Fluent Validation) for a variable
ASP.NET MVC
Firstly, all the validation rules are firing except the ...
0
votes
1
answer
71
views
ASP.NET MVC Create View - Where to place ValidationMessage (Fluent Validation) for a variable
I have this validator class:
...
1
vote
1
answer
69
views
Button to save edit in its current model and then return you to previous Details view of a different model
I am using ASP.NET MVC. I have a PIF controller and on the details view, I have data showing from a variety of other models, one of which is called SAEs (I will use this as the example). For each of ...
0
votes
1
answer
49
views
Dropdown list choice not linking to underlying table in Details.cshtml when dropdown list is used for more than one field
I am using ASP.NET MVC with a SQL database backend. I have a table that lists individuals which I use for two fields in another table. One field is for the Chief Investigator (ChiefInvestigatorID), ...
1
vote
1
answer
56
views
href being interrupted by database login
I'm using ASP.NET MVC. This code sits in the Index.cshtml view (I will also place it in the details view). I have a href link ...
0
votes
0
answers
85
views
ASP.NET MVC model binding FormData with arrays (with bracketed indexes)
Using model binding, ASP.NET MVC can take FormData from a form with repeating elements, signified by the use of indexes in square brackets, and populate a .NET ...
1
vote
1
answer
197
views
"Resource not found for the segment" error reading email from Graph API
I have an Outlook web add-in which reads the currently selected email from Exchange Server, using the Graph API, before doing further processing on it. The relevant code is:
...
0
votes
1
answer
50
views
Kendo MVC Grid Row Filter without decimals
I have a kendo grid on an MVC site with several integer columns, and I am using a row filter. The problem is that when you enter a number in the filter, it shows up with commas and two decimal places.
...
0
votes
0
answers
81
views
ItextSharp C# : combine multiple PDFs with AcroFields specified
I have multiples PDF created with the iTextsharp library in C#. Those PDFs are created and are also using AcroFields.Item to create fields and field them with the ...
0
votes
1
answer
123
views
Does the dynamic keyword box the value types? [closed]
This project is ASP.NET MVC Framework 4.8 with Entity Framework 6 and uses:
dynamic GetSystemSetting(string paramCode, string paramType)
It contains Int, Float, ...