Questions tagged [asp.net-mvc-5]

ASP.NET MVC 5 is the fifth major version of the ASP.NET Model-View-Controller platform for web applications.

asp.net-mvc-5
Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

How to run an ASP.NET MVC 5 application with .NET framework from VS Code?

It might be a dumb question: I've created a project with Visual Studio using the ASP.NET framework, but I don't have Visual Studio on my work machine, so I'm using Visual Studio Code. How can I run ...
Lucas's user avatar
  • 11
0 votes
0 answers
98 views

Selecting a Default Option on Load for a .NET MVC Grid

I'm working on an MVC application in .NET 4.5.2 that uses the NonFactors MVC5 grid. Here's a website with the documentation: https://mvc-grid.azurewebsites.net/ I am running into an issue while trying ...
ruryno's user avatar
  • 1
1 vote
0 answers
117 views

ASP.NET MVC 5 - order notification; receive real-time alerts for new customer orders

We have two different applications in ASP.NET MVC 5. The first application is a website to place an order by user; the user has to sign up to the account to place an order, and the other is the ...
Ahsan Ali Siddiqi's user avatar
0 votes
2 answers
41 views

authenticate API endpoint with .Net Classic MVC 5 Web App

I have a .Net Classic web app. We are revamping the whole thing, and the frontend is being stripped out and moved to another framework. Some elements of this app will remain, to be ported to .NET Core ...
Scuba Steve's user avatar
  • 1,611
1 vote
0 answers
114 views

System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent

I have an application that is spitting out tonnes of exceptions to the log and they're all the same 2023-07-06|05:09:34.6824|142|Error|System.Web.HttpException (0x80004005): Server cannot set status ...
Bug Maker's user avatar
  • 503
0 votes
1 answer
111 views

What is the current ASP.NET MVC replacement for @Html.Serialize and [Deserialize]?

I'm trying to update my ASP.NET MVC 5 web site gradually so I can eventually migrate to ASP.NET MVC Core. I used to put some data in hidden fields and use @Html.Serialize("name", value) it ...
Wout's user avatar
  • 624
0 votes
0 answers
25 views

How and where do you validate business rules in an Asp.net MVC applicatin?

I'm new to ASP.NET MVC and while developing my first application, I have a few questions. One is: which is the best way to validate business rules? In my Edit post method, for example, I check ...
Liuc's user avatar
  • 47
0 votes
1 answer
44 views

How to send AntiForgeryToken with ajax call

In my index view , for each item in the list, there is an actionlink to delete the record. The action link url is of type "/Controller/Delete/id" When th actionlink is clicked a modal popup ...
Liuc's user avatar
  • 47
0 votes
0 answers
27 views

Html.ValidationSummary display custom validation error message

I have a view (skipping redundant code): @model ListinoTariffeViewModel @using (Html.BeginForm()) { @Html.ValidationSummary(false, "Impossibile salvare. Correggi gli errori:", new { @...
Liuc's user avatar
  • 47
0 votes
0 answers
26 views

Modal form validation issue

I'm experiencing a weird behaviour while validating a modal form. I try to submit the form twice without entering any value just to test validation. Validation is server side (I'm not able yet to ...
Liuc's user avatar
  • 47
0 votes
0 answers
32 views

Problem to open two forms in the same modal view

In my application I use the JavaScript\jQuery code below to load two forms in the same modal divs: View: $(document).ready(function() { $.ajaxSetup({ cache: false }); $.validator....
Liuc's user avatar
  • 47
0 votes
0 answers
43 views

ASP.net mvc with angular js Failed to start 'npm'

I'm Working on Visual Studio 2022. tried to npm install in node js latest version and also in 14.17. tried to npm install latest angualr version and aslo tried 8.3.22. clean cache before installing ...
mohamed tarek's user avatar
0 votes
0 answers
12 views

Best practice to implement viewmodel classes?

Suppose you have a model made up of these classes: public class Employee { public int Id { get; set; } public string SerialNumber { get; set; } public string Name { get; set; } public ...
Liuc's user avatar
  • 47
0 votes
0 answers
8 views

Can a DisplayTemplate displays model in different way if it is a singole object or a collection?

I have a ServiceViewModel class. Someties in my application I have to display a single service, but sometimes I have a list of service. I use a DisplayTemplate to display the single service in a way ...
Liuc's user avatar
  • 47
0 votes
0 answers
19 views

ASP.NET MVC Unable to post data to server when there are multiple upload controls

I have the following UI where I am telerik controls and posting the data to server @using (Html.BeginForm("Add", "Storage", FormMethod.Post, new { @id = "frmItem", @class ...
Developer's user avatar
  • 8,500
1 vote
0 answers
32 views

Disable server side validation rules for hidden view controls

Which is the proper way to disable validation rule on server side for those controls that are hidden on the client side? As far as I know, client side validation is automatically disabled for hidden ...
Liuc's user avatar
  • 47
0 votes
0 answers
100 views

Add new row to the view model collection (ASP.NET MVC 5 and EF6)

I would like my Employee edit view looks like the screenshot here: It's a simplified version of my page, but basically editing an employee means add a new job position (if any) or change the services ...
Liuc's user avatar
  • 47
0 votes
1 answer
71 views

ASP.NET MVC 5 - One View for multiple action methods?

In my application I need three views that shows the same data :Employee details data toghether with employee job positions (job history). They differ only for some buttons. AS you can see in the ...
Liuc's user avatar
  • 47
1 vote
1 answer
47 views

Default attribute routing not worrking in ASP.NET MVC

I'm trying to use attribute routing in my application. I provided the route attributes to all action methods and also provided the HTTP verbs to the action methods. But I am not able to set the ...
Srikanth Reddy's user avatar
0 votes
0 answers
18 views

How to implement "model entity state changes". My solution

I’d like your opinion about my solution. I have Employees data imported from an external database. For the purpose of my application I can only see Employee details, change the Employee’s state (...
Liuc's user avatar
  • 47
0 votes
1 answer
73 views

ASP.NET MVC: How can I redirect to a previous action or a specific action after form submission?

My pages have the form: site.com/inventory/Query site.com/inventory/Results site.com/inventory/Details?item=123 View On Details, I have a button to upload the item data sheet in the View: using (...
podrick's user avatar
  • 83
2 votes
1 answer
149 views

Forcing SnakeCaseNamingStrategy doesn't work in ASP.NET MVC

I'm trying to force both serialization and deserialization to use SnakeCaseNamingStrategy but no luck. Here is what I have used in Global.asax.cs: protected void Application_Start() { ...
Hooman Limouee's user avatar
0 votes
0 answers
42 views

If I have async middleware in ASP.NET Core 6/7 and I am getting 1000 request will there be 1000 threads (created by async) and one main thread? [duplicate]

If I have async middleware in ASP.NET Core 6/7 and I am getting 1000 requests, will there be 1000 threads (created by async) and one main thread? public async Task InvokeAsync(HttpContext context) { ...
Rushee's user avatar
  • 766
1 vote
2 answers
247 views

Stored procedure with EF6 Code first - best practice?

In my program I have to import data from a remote sqlserver database. I am using ASP.NET MVC 5 and EF6 Code First (I'm new with EF and MVC 5). First, I copy data from a remote view to a table in the ...
Liuc's user avatar
  • 47
0 votes
0 answers
36 views

What causes 'Runtime Error' when using Crystal Report in ASP.NET MVC 5 project?

I have an ASP.NET MVC 5 project and I used Crystal Report in the project. I get this error, it's the first time I've encountered such a thing, I've been dealing with it for a few days, and I couldn't ...
Yaqub Rahmani's user avatar
0 votes
0 answers
26 views

Why am I getting errors on all my cshtml files when using Html Helpers in MVC 5?

This is my code I'm getting errors on all of my .cshtml files where I use Html helpers. @using System.Web.Mvc @Model IEnumerable<storedprocedrure.PersonalInfo> @{ Layout = null; } <html> ...
huzaifa abdul razzak's user avatar
0 votes
0 answers
132 views

Issue with ASP.NET MVC 5 and Bootstrap 5 Theme

I dont' know why the code generated by VS2022 for MVC 5 project has css class name different from that one used in bootstrap theme. For validation error, for example, asp.net generate ".field-...
Liuc's user avatar
  • 47
0 votes
0 answers
22 views

How can i bind same column in DbModelBuilder for IdentityUser's two different properties

This is my table SELECT TOP (1000) [Id] ,[Adi] ,[SoyAdi] ,[Maili] ,[Sifresi] ,[Adresi] ,[Telefonu] ,[KurumAdi] ,[VergiNo] ,[VergiDairesi] ,[...
Halil Kirişci's user avatar
0 votes
0 answers
15 views

Use different connection strings at Home and Office

I need to connect to a different database location while working at Home than the one used at office. How can I change connection strings in my asp.net mvc5 code? Do you think that using Conditional ...
Liuc's user avatar
  • 47
0 votes
1 answer
98 views

jquery pass null to action controller parameter even value not null

I have Action method in controller as below [HttpPost] public ActionResult UploadFile(HttpPostedFileBase file, string foldername) { string folderpath = "~/...
Nathan Dang's user avatar
0 votes
1 answer
52 views

ASP.NET MVC controller upload photo and save folder path

The method I use works on other servers. It works on my computer but not on the server I just rented. public JsonResult SaveRegesterPhoto(string mImage) { if (string.IsNullOrEmpty(mImage)) { ...
Yaqub Rahmani's user avatar
0 votes
0 answers
250 views

Microsoft extension logging with ASP.NET MVC & VB.NET and Unity dependency injection

I'm trying to use Microsoft extension logging in ASP.NET MVC 5 with dependency injection using Unity but its not showing any logs in the console. Here are my complete code, Global.asax.vb: Sub ...
Ris's user avatar
  • 1,162
0 votes
0 answers
48 views

How to push a notification to flutter app for IOS/android from asp.net mvc 5?

I’m building a car rental flutter application to let the users reserve a car and I'm building an asp.net admin side to accept the reservation or reject it so, I want when the admin takes this action I ...
Noor Eddin Hasan's user avatar
0 votes
1 answer
26 views

MVC5 [Route] attribute for parameterless endpoint not working

I have an MVC 5 application with an Angular front end. I am having issues in calling parameterless endpoints. The MVC application has a controller which the Angular application calls for data. For ...
Mable98's user avatar
  • 41
1 vote
0 answers
116 views

How can I use Transaction in EF in ASP.NET MVC 5 Clean architecture?

I have read the Clean Architecture Document and eShopOnWeb of Mr. Ardalis and implemented them in my project, ASP.NET MVC5. Also, I have implemented IUnitOfWork. I have three layers in my project ...
Ahsan Ali Siddiqi's user avatar
-1 votes
1 answer
152 views

Singleton or static in class library [closed]

I have an ASP.net MVC 5 web application which is interacting with an external framework, actually it is a web interface for that application. My Application interacts with a wrapper of the SDK (app ...
Yasser Sobhdel's user avatar
0 votes
1 answer
495 views

Unable to validate the 'id_token', when specifying scope with OpenIdConnect

I have an app that is written on the top of an old ASP.NET MVC 5 framework using C#. I want to enable OpenIdConnect authentication to allow my users to authenticate using a private OpenId server. I ...
Jay's user avatar
  • 1,682
1 vote
0 answers
112 views

how to auto register users after valid OpenIdConnect authentication is ASP.NET MVC 5 app?

I have an app that is written on the top of an old ASP.NET MVC 5 framework using C#. I want to enable OpenIdConnect authentication to allow my users to authenticate using a private OpenId server. I ...
Jay's user avatar
  • 1,682
1 vote
0 answers
72 views

Emgu.CV.MatInvoke' threw an exception

DllNotFoundException: Unable to load DLL 'cvextern': The specified module could not be found. (Exception from HRESULT: 0x8007007E) [HttpPost] public ActionResult DetectFacesAndBlur(string ...
Ahsan Ali Siddiqi's user avatar
1 vote
0 answers
98 views

How to receive raw JSON as an .NET MVC 5 action method parameter without creating a specific Model

I am sending a JSON string (JSON.stringify(data)) as body in a POST request from client to .NET MVC5 app. Request header has the content type of application/json (I do not want to change this to text ...
Teja duggirala's user avatar
0 votes
0 answers
27 views

How to make an insert form and a table displaying data from database in a single view in MVC5 using Entity Framework

List and create in same view in asp.net mvc5 with EF I need to display the data in grid after submitted users details: simply I have Form: name , city @Create Table @Index
naresh nagaraj1996's user avatar
0 votes
0 answers
172 views

Python script working properly on my ASP.Net MVC5 web application BUT not working after I publish my web app on my local server

I have created a function in my C# MVC5 web app that calls a python script to create a folder on a network drive. When I test my application, the script runs perfectly after the solution is built, ...
amouawad's user avatar
2 votes
2 answers
658 views

How to provide model documentation and example value using Swashbuckle?

I have created an API method using Web API 2 (MVC 5), as shown below: /// <summary> /// Import all of the jobs for the given organisation. This method assumes that all of the organisation's ...
Hooman Bahreini's user avatar
-1 votes
2 answers
47 views

Difference between data fetching through AsQueryable() and through ToList() in ASP.NET MVC 5

I want to know what the exact difference is between the two methods - and when we need either of the two? I want to improve my querying skills.
Muhammad yaseen's user avatar
1 vote
1 answer
668 views

How to make use of .net Standard 2 IFormFile reference in .net Framework 4.7.2 MVC web app

We're working to convert a couple of legacy .net framework 4.7.2 web apps to .net core. We're using the .net standard libraries to allow our infrastructure to be updated before we get the web sites ...
geoff swartz's user avatar
  • 5,773
0 votes
1 answer
275 views

Using MathCaptcha in MVC 5

I am running MVC5 and am trying to implement CAPTCHA in my web application. I installed CaptchaMvc.Mvc5 (version 1.5.0) and when I try to use the HTMLHelper in my View, it is giving me a red squiggly ...
Ron's user avatar
  • 1,911
0 votes
0 answers
79 views

Asp.Net MVC long time reload after deploy

ASP.NET MVC 5, .Net Framework 4.7.2, IIS 10, Windows Server 2019 (dual core cpu, 6gb mem), deploy by Web Deploy from Visual Studio 2019. The application itself works quickly, there are no problems ...
Andrew G's user avatar
1 vote
2 answers
114 views

How can i show partial view with tuple?

I'm using a partial view in my program. How can i assign this partial to a value tuple and passing to my views in asp.net mvc 5? this is my code but doesn't work my controller var op = checkBook....
خشایار اخوت's user avatar
0 votes
1 answer
83 views

C# & ASP.NET MVC 5 : optional string in route URL using regex

I'm trying to determine if it's possible to have an optional section of a string in a given route URL using C# and ASP.NET MVC 5. For example: [HttpGet] [Route("~/hot-dogs{withMustard:regex(-with-...
W. Bowley's user avatar
0 votes
0 answers
285 views

Pass route parameter with form submit ASP.NET MVC 5

I am building an ASP.NET MVC 5 application (.NET 4.8) and I'm trying to pass an additional route parameter with form submit to a controller method. Why am I doing it like this? In short, as it is a ...
dzenesiz's user avatar
  • 1,444