Category "asp.net-mvc"

How to avoid InvalidModelStateResponseFactory to interfere with an error response already generated in FluentValidation

I am working on a .NET Core 3.0 MVC project using FluentValidation, for validating input from the front end made in React. I can't rely on that the input is val

Importing excel table to ASP.NET C# MVC

I have table in a excel sheet called ListProduct.xls. When I import the excel file I want it to print the table in success page. The index page works fine I can

asp.net mvc @ put out wrong unicode string

<meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <meta name="description" content="@("Du lịch chữa bệnh ở

Not allowed to load local resource:

i want to stream online videos ..but i am facing j query error Not allowed to load local resource: ...i find many solution but that all did not work for me. he

localhost refused to connect Error in visual studio

I have copied my solution file from another system and tried to run it on my machine: For this, I have gone to the project folder and deleted the previous solut

Could not load file or assembly System.Web.Http.WebHost after published to Azure web site

I created a web project and it runs well in Visual studio. However, I got the following error after published it to azurewebsites. What can cause the issue?

How to pass model as a Parameter in Repository method at controller?

So my problem is like that, When I am trying to pass the model in repository method on controller I getting error like this Object reference not set to an insta

Why images paths not store in database MVC5?

I'm new to MVC so I hope to get help regarding my question. I am making users upload images. the image path will store in the database but the image itself will

Asp.Net MVC - ViewModel vs Domain Model vs Entity Model [closed]

Have been through many artciles, but didn't get enough clarity on the usage of the 3 different models mentioned. As we know, View Model - is

Sorting a 1-to-many relationship for a log table for the most recent item

So I have a table, Equipments, that contains assets. There is a table connected to this one in a 1-many relationship that logs each time it is inventoried, by w

When using ASP.NET MVC, what is the best way to update multiple page sections with one HTML.Action() method?

I have a pretty big ASP.NET MVC site with 100 controllers and thousands of actions. Previously the header image that was defined on the Site.Master page was ha

Displaying an iframe with @Html.Raw is not working like when displaying Script with @Html.Raw

Note: This is written in asp.net mvc 5. That is the tech I am using for this. I am used to displaying certain data when I use @Html.Raw to show data from a Mode

'HttpClientFactory' does not exist in the current context

I'm writing an application in C#. It pulls the data from Cloudant NoSQL DB. But when I'm trying to create the Http client: HttpClient client = HttpClientFacto

How to effectively change authentication method in ASP. NET web.config?

I am trying to launch ASP.NET project on a local computer. IIS responds with 401.0 status code, stating that "authenticated user does not have access to a resou

Web.config causing "blocked by group policy" error

The myriad of different web.config settings have always been a bit of a mystery to me. I'm glad Microsoft has cleaned up some of the content put there by defaul

How do I post SQL data using submit button in asp.net c# razor

Thanks in advance. Can anyone please help me get this button working so I can display a row from the Northwind database 'only' when the button is clicked. I h

Returning BadRequest in method that returns PartialViewResult

I have an MVC5 application that has a method populates and returns a partial view. Since the method accepts an ID as a parameter, Id like to return an error if

How to Bind a group by data in view in mvc5? what are the best ways to do

I am using Entityframework context, i dont know how to bind to view. I am grouping items by gender public SQLChallengeEntities Sqlcontext = new SQLChallengeEn

How to set up a stub and assigning a webresponse with Rhino mocking

I'm completely new to Rhino Mocks and mocking in general. I'm still wrapping my head around how to code the mocks. I have a test class which contains something

"Select all" in Kendo MultiSelect (MVC)

I have a Kendo Grid with some custom editors, one is a multiselect. I have a cshtml file for the editor that looks like so: @model IEnumerable<ManageSitesInT