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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Can not run website in mvc project on Rider (JetBrains)

Does anyone use Rider from JetBrains? I'm creating an ASP.net MVC project like on Pic 1. When I open in browser, it can't run (Pic 2). I think there might be a port conflict, so I tried changing the ...
minhngane's user avatar
0 votes
0 answers
13 views

How create global function for use all views in ASP.NET MVC 5

I am trying to migrate my old web app version to .NET 7, and now like App_Code in previous version, I want to call my helpers from all views. I found this and write this below one partial view: @...
rahman's user avatar
  • 101
0 votes
1 answer
19 views

Allow user to choose download path : MVC 5 Jquery

There might be possibility of duplication...but I didn't get any answer How can I allow user to select downloadpath while clicking Download button? I need to use that folder path only in my web ...
Ankita's user avatar
  • 1,416
0 votes
1 answer
28 views

How to implement .NET Core tutorial to .NET Framework?

I am working on a project in ASP.NET Framework 4.7.2 which uses Azure AD and MSAL to access data from server API within my company. However all the Microsoft tutorials are for .NET Core, and there no ...
Ibrahim Memet's user avatar
0 votes
1 answer
44 views

Getting ObjectDisposedException when IFormFile.CopyTo from another Context

I have an mvc core app that I am uploading and processing an .xlsx document. I want to make the initial POST call, create a new async task to do the processing work, while the post call returns me a ...
DeepToot's user avatar
0 votes
2 answers
44 views

One to One and One to Many Optional Entity Framework

I have a model like this : public class PortStackingDetails { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public int? ...
Jun Rikson's user avatar
  • 1,964
0 votes
1 answer
41 views

Loading image using Javascript

My application is MVC5; I am trying to load an image using JavaScript as follows: <img id="id1" class="img-responsive"/> var img = new Image(); img.src = "~...
hncl's user avatar
  • 2,293
1 vote
1 answer
12 views

MVC5 Validator Error With Date and DateTime in same page

I have a date and a datetime field in my model : [Display(Name = "Tanggal")] [Required(ErrorMessage = "Tanggal harus diisi.")] [DataType(DataType.Date)] [DisplayFormat(...
Jun Rikson's user avatar
  • 1,964
0 votes
0 answers
29 views

Linkedin login through owin.security.OpenIdConnect in .net4.7.2 and MVC5 based webapplicaiton

Currently I am working on a website developed using .Net 4.7.2 and MVC5. Received a requirement to implement Linkedin authentication using "OpenIdConnectAuthentication" from owin.security....
Thavudu's user avatar
  • 235
0 votes
0 answers
19 views

No ASP.NET MVC 5 Partial Page (Razor) in Add >

I'm supposed to add an ASP.NET MVC 5 partial page (Razor) to my project, I must do this to create a view called LatestTweets.cs.html. When I right-click on Partials > Add > I cannot see any ASP....
training_1986's user avatar
0 votes
0 answers
13 views

Attached file issue when sending mail with MVC5

I want to send campaign mail to customers. There is a PDF file attached. My contact list is an MS SQL table. I used foreach to select each recipient. All emails have an attached file but only the ...
ibrahimerd's user avatar
0 votes
0 answers
25 views

Include ENUM in a new ASP.NET MVC project

I've created a new ASP.NET MVC project running on .NET 4.8. I've added classes, controllers, model, interfaces... and it builds properly. Now I need to create an enum but I'm missing something here. I'...
rd1218's user avatar
  • 143
0 votes
1 answer
38 views

Using EZFontResolver (PDFsharp) throwing an exception when setting it

I'm trying to include a private font into my PDFsharp (v1.51) document drawing process. I'm using the EZFontResolver as explained here Here is what I'm doing: public byte[] GetCertificate(...
Romias's user avatar
  • 13.8k
0 votes
1 answer
25 views

ASP.NET MVC5 area section override route action

I'm encountering issues on controller routes when using area section. My home controller (located in the main root) has an action result for logout/signout session. I created a "configuration&...
chris_dev's user avatar
1 vote
2 answers
106 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
38 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
41 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
33 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,550
1 vote
0 answers
64 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
  • 454
0 votes
1 answer
80 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
15 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
29 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
18 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
22 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
28 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
24 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
10 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
18 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,420
1 vote
0 answers
25 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
54 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
56 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
36 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
15 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
57 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
  • 39
2 votes
1 answer
65 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
41 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
76 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
20 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
23 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
86 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
18 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
88 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
47 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
117 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,150
0 votes
0 answers
25 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
19 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
50 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
77 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

1
2 3 4 5
314