Category "asp.net-mvc"

Getting an invalidcastexception when trying to retrieve data

When running the get method to return a view populated with details, I get the exception saying: System.InvalidCastException: 'Unable to cast object of type 'Sy

Operator "missing" not working properly in JsonLogic

I am using JsonLogic to validate my input payload with the rules defined using JsonLogic. I am able to test the rules using "Play with it" tool and my rules wor

C# renamed class reference issue

We have ASP.NET MVC application which is running on windows server machine. I have renamed classes to satisfy sonar scanning. The code deploys and runs without

Tenants Not Loading When Adding Azure AD Service Dependency

I'm attempting to add an AAD service dependency to a new ASP.NET Core Web App (MVC) project. I went to Connected Services, clicked on "Add a service dependency"

Compilation error after publishing individual Razor page. Persists after publishing entire project. ("Compilation references may be missing")

Today I was working on a .NET Core 3.0 project (VS 2019). I added a CSS class to a <span> on one of my pages. That's it. Nothing else. I figured publishin

Redirect to Action not working using MVC asp.net

I have a requirement, where I validate user using Windows Authentication. Till there it works perfectly fine. But when I try to redirect to respective controlle

Replace Text into an existing PDF document in a specific positions in JavaScript & Asp.net MVC?

I have an existing 20-page pdf file. I need to extract data from our database and incorporate it into a pdf document for specific positions. I did research on G

NET Core 3.1 MVC Authorization/Authentication with token (JWT) obtained externally in separate Net Core 3.1 Web Api

I have 3 projects: Net Core 3.1 MVC project. Net Core 3.1 Web Api project with JWT auth --> connected to db via Entity Framework (Xamarin app that also uses

414 (Request-URI Too Long)

I am working on MVC platform and I am calling jqGrid using JSON GET. I have read on Request Limits, maxQueryStringLength, maxAllowedContentLength, maximum leng

Update From Bootstrap 3.7 to 5.0.2 in .net mvc producing Error- System.NullReferenceException

I uninstalled the basic bootstrap template that comes with .net MVC Application and installed the bootstrap 5.0.2 from NuGetPackage Manager. Now I am Encounteri

ASP.NET MVC: Method for HttpPost is not executed

In an ASP.NET MVC application, I have a file MessageController.cs where I define EditMessage for access via HttpGet and HttpPost. Usually the user first accesse

ASP.NET MVC - how to zip and download files from database?

I'm new to ASP.NET MVC and I'm trying to figure out how to zip and download files stored in a database. Do I need to zip the files, save them in memory or serv

HttpContext.Request.Form threw an exception of type 'System.InvalidOperationException' - why?

I have a strange problem. We are using C# for an ASP.NET MVC application, and JavaScript with jQuery and Data Tables for the frontend. In the frontend, a part o

How to generate heap overflow error using c#

I want generate a heap overflow error and slow down the system, however I have created alot of objects on class level, later on creating that class object milli

ASP.NET MVC 5 Cache CSS and JS Files

I am using ASP.NET MVC 5. My goal is to cache CSS and JS files for at least 24 hours. I tried this code with no luck: https://docs.microsoft.com/en-us/iis/con

ASP.NET Core 3.1 MVC Routing issue with IIS Default Web Site

New information: After much messing around with trying to manipulate the URL I almost got it working but not quite. Then I discovered that it works without any

ASP.NET Core 5 MVC localization query string working but routing not working

In trying to localize my application, the query string localization has worked and accept language header also working, but routing is not working. Here is my c

Minimum Google Chrome and Microsoft Edge Version for stable running ASP.NET MVC, Vue.js application

We use latest ASP.NET MVC, Vue.js at company. Is there a version for chrome and Microsoft edge that you can say that it should be above the following version in

ASP.NET MVC (Razor) vs Angular 5

We are currently considering moving from ASP.NET MVC to Angular 5, mostly because it seems like the best and latest framework. However none of us seems to be ab

ASP.NET MVC Core API Serialize Enums to String

How to serialize Enum fields to String instead of an Int in ASP.NET MVC Core 3.0? I'm not able to do it the old way. services.AddMvc().AddJsonOptions(opts =&g