Category "asp.net-core"

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

Why folders in VS 2019 shows red cross 'X'?

My Observation: Its for empty folders or for empty folder hierarchy. If I add the folder again then cross is removed. (I have re-sharper installed, and don't k

Azure Cosmos DB to fetch paged results along with all records count

The document structure is like this [ { "id": "1234", "SubmittedAnswers": [ { "PlantId": 3, "UniqueQualityId": "3_pe55d74fc5f92b

When refreshing a page developed by nextjs error occurred

I have developed a project by nexjs which their backed is IIS and all these are working properly. I have an URL address like this : dastshafa.ir/product/2/

How to solve Dependency injection and Inconsistent accessibility parameter type '' in .Net 3 Worker service?

I am setting a .Net core worker services that will get some data from the database and pass that to an endpoints. So I am trying to set it up base on my .net MV

Microsoft.AspNetCore.Identity.IdentityError: "InvalidUserName"

I did default Megration with User model, added only my two custom properties. EF created standard flow of tables. And my AspNetUsers table As you can see User

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

Get the very last part of a Url to use in a ternary operator

I've very new to C# and I'm using ASP.NET 6. On a .cshtml Razor page I'm trying to use a ternary operator to fill in a HTML element class based on the very las

Error: System' could not be found (are you missing a using directive or an assembly reference?) in vs 2019

I tried creating a asp.net core web application with mvc in visual code 2019 and as soon as I open it it showes me a lot of errors like in the picture. enter im

Bind Dropdownlist with TagHelpers

I am trying to create a dropdownlist and bind with viewbag using ASP.NET Core tag helpers. I can bind the dropdownlist using: @Html.DropDownList("Area_id",

ASP.NET Core CSS Isolation with Webpack

My ASP.NET Core RazorPages project uses Webpack. I also want to use CSS Isolation. Every RazorPage Foo.cshtml has an associated css file Foo.cshtml.css. These

How to configure NewtonsoftJson with MinimalApi in .NET 6.0

I have net6.0 project with minimal api and I would like to use NetwtonsoftJson instead of built in System.Text.Json library for serialization and deserializatio

(.Net Core) How to test connection to db at startup?

.Net 6.0, EF, Asp.Net Core I'm trying to interrupt my web server's startup if the connection to the db could not be established. I'm thinking that the natural p

Google application credentials in azure app service (aspnet core web api)

So I am using Firebase SDK to send push notifications to my android clients. On local IIS this is how I have configured FirebaseSdk. In Startup.cs I have Fir

How to dynamically change background-color in ASP.NET MVC core?

I had an idea of changing a background color of a div when I click a button. I added a string in my 'Subject' model class as so: [NotMapped] public string Colo

ASP.net Core: There is already an open DataReader associated with this Connection which must be closed first

I have an ASP.Net Core application, and I'm using Microsoft identity, I'm trying to add a page to manage users roles, in the action result i defined a variable

.NET CORE, how to get file location for an exception in a web app, in middleware?

I've seen this question: How can I get the line number and file name from an exception in net Core? And tried the code, but it always says line 0 and no file na

ASP.net Core Identity 3.1

What is the suitable service to provide email confirmation and password reset. i have tried smtp but after six attempts actually it considered those emails as s

Docker errors when trying to build in ARM64 Apple M1: "Failed to resolve full path of the current executable [/proc/self/exe]"

I'm having trouble building docker containers on an Apple M1 The project uses sdk 2.2 which is incompatible with arm64 architecture. So I changed the sdk and as

Ignore global query filter for joined entities

Global query filters are very handy when implementing tenant and soft deletion features. But my problem is is that when i write a query with joins, for instance