The ASP.NET MVC Framework is a Microsoft web application framework that implements the model-view-controller (MVC) pattern.

learn more… | top users | synonyms

0
votes
0answers
3 views

should I create dbContext for my models or use existing ApplicationDbContext?

I'm developing web application using ASP.NET Core. When I use project template Web Application with Authentification: ApplicationDbContext class generated: public class ApplicationDbContext : ...
1
vote
1answer
78 views

Complicated Authorization Based on dynamic criteria

I am sorry for not posting any code. I am stuck at the design phase -that's why- What I want to accomplish is: allowing system administrators of a 'Staff Task System' to dynamically set rights to a ...
3
votes
1answer
96 views

One huge ViewModel or (ab)use database for each view

I'm in the process of designing an application structure and am currently thinking how to structure my asp.net MVC5 front-end. My application is wizard-like with tabs for each step. It's not a strict ...
1
vote
1answer
33 views

Building a Model using MVC 5 optimally that is Database friendly?

I'm using MVC 5 Core on my Web API and I wanted to know what is the most optimal way of storing an Array into a database? Should I store Arrays, does it matter, or should I parse the array and input ...
1
vote
2answers
93 views

Writing business logic in view

Can writing business logic in the view(.cshtml) of an MVC application have an impact on performance (for example, Load time)? Is it the preferable way or are there any other best practices?
-1
votes
3answers
83 views

Can I use ASP.net MVC 5 for creating a Single Page App without any front-end framework?

I want to build a web app that have multiple pages. Each page must act like a SPA (interacting with users and create dynamic elements). Is ASP.net MVC capable of handling front-side jobs as well or I ...
0
votes
1answer
30 views

Best way to rewrite an mvc application to an angular architecture

We have an mvc application that we would like to gradually move to an angular platform. It is a wizard style app with 6-8 pages. We currently have a classic mvc layout. We would like to move to an ...
1
vote
1answer
47 views

Should I inject a mapping class in an ASP.NET MVC controller

I have a discussion with a colleague. He thinks we should inject a mapping class (for mapping the domainmodel to a viewmodel) in a controller. He thinks we now can test the mapping class (which is an ...
0
votes
0answers
65 views

Best Approach for Multilanguage Website - ASP.NET MVC Routing vs AngularJS Routing Translation

So I am building my website with the option for changing language on the entire website, now it came up the question to my mind.. should this be done my the server (using in my case ASP.NET MVC) ? I ...
0
votes
0answers
45 views

Correct place for linq to DB requests in MVC app

Currently i see linq requests everywhere in solution(controllers, helpers, business logic, repositories). I would like to store all of them at one place(hope this will prevent duplicates and make ...
0
votes
3answers
433 views

What is wrong with a standard MVC project?

I am discussing the architecture for a new project with some colleagues. The project is relatively small and can be considered as a 'normal' crud web application. Everybody has come up with an ...
3
votes
0answers
56 views

Architecture for UI Components Re-use in ASP.NET MVC

I've done a number of LOB ASP.NET MVC projects (MVC5) and would like to re-structure how I handle some things for a new project. Specifically, I have a component that I want to re-use throughout ...
0
votes
1answer
182 views

How to go about upgrading spaghetti code? Is it worth it? [duplicate]

I'm working on medium sized ASP.NET MVC 4 web app, that is about 2.5 years old. Around 25-30k lines of code. The project has never followed any of the good .NET design practices. It is a very tightly ...
1
vote
1answer
109 views

Caching data vs. caching output

I don't have much experience in caching among web applications, but I am trying to educate myself in the field and try out various techniques and approaches in ASP.NET MVC. The majority of tutorials ...
0
votes
1answer
51 views

asp.net MVC 5 - Does it matter if my ModelState is not valid & I don't need it to be?

I have a top10 table (like top 10 restaurants say). Each top 10 row can have up to 10 top10items associated. Models public class Top10 { public Guid Id { get; set; } [Required(ErrorMessage="...
0
votes
0answers
88 views

ASP.NET: Creating an interface for a controller

Would creating a controller's interface a bad idea? I have a controller that derived from ApiController, so knowing that you can only derived one class to a class but able to derived one or more ...
0
votes
1answer
46 views

MVC versus Webforms in a specific situation

I have seen questions similar to mine, but there are some unusual specifics to mine not covered. I have a SQL SERVER driven ASP.NET web app (website). I am using the older webforms model, not MVC. I ...
0
votes
1answer
98 views

How can I move from Web Forms to ASP .NET MVC 5?

I've been using Web Forms for way too long now and I want to switch to ASP .NET MVC 5 because I think that it's the "next step" for a ASP .NET developer. I also find it to generate pages a lot faster ...
1
vote
0answers
127 views

Large controllers in ASP.NET WebAPI, How to organize

I have a large WebApi project with a few dozen controllers. Each controller represents an endpoint prefix, just as a normal MVC project would. For example: CarsController.cs represents http://api....
1
vote
1answer
57 views

ASP.NET MVC models, EntityFramework and Automapper

It happens so that the best practice of using EntityFramework includes taking advantage of the IQueryable inside using block, like: using (var ctx = new SomeDbContext()) { ...(do something with ctx)...
0
votes
1answer
100 views

MVC - Best practice of passing data from partial view to parent view

I am trying to create a partial view (re-used many times) that will prompt the user for data and return that value to the parent view. My best solution so far is to pass to the partial view the name ...
1
vote
0answers
49 views

Can I do a POST AJAX to an MVC Controller or should I use Web API?

The page is loaded as a normal MVC page. The ajax is so the user can add items to their model without having to reload the page. Right now there is no Web API in the project. I don't want to add it ...
2
votes
2answers
123 views

ASP.NET MVC: where to put data-entry logic which hits the database

We do simple data entry validation with attributes on the viewmodel. Think format of an email address, mandatory clientname, format of a date, the housenumber being numeric etc. Now there are also ...
0
votes
0answers
35 views

Best method to allow user to choose multiple things from my DB?

So I have a "Bars" table in my database and a "Add a Bar" form which allows a bar owner or manager to add his/her business listing to my website database. I also have a "Beers" table in my database ...
1
vote
0answers
35 views

Are there any performance considerations when reading web.config AppSettings?

I'm writing a REST service with Web Api. One of the actions reads an AppSetting value from the web.config during execution. I would assume the web.config is loaded into memory, but during high load, ...
2
votes
1answer
60 views

Handling a violation of n multiple unique constraints in insert

I have an asp.net mvc 5 site. I have a places table / POCO with 3 unique constraints (URL, Email & obviously ID). Users are able to add places - but they may violate URL or Email unique ...
0
votes
0answers
315 views

How to incorporate windows authentication with ASP.NET Core & AureliaJS project

We are creating a project using Aurelia/Typescript. For those who don't know what that is, it's basically a better AngularJS (opinionated). Our project runs perfect, except for the fact that we need ...
7
votes
3answers
429 views

Why would you ever 'await' a method, and then immediately interrogate its return value?

In this MSDN article, the following example code is provided (slightly edited for brevity): public async Task<ActionResult> Details(int? id) { if (id == null) { return new ...
0
votes
2answers
108 views

Can someone explain the Model in ASP.NET MVC?

I have developed in the past always classic ASP.NET solution. I am starting currently to develop ASP.NET MVC solutions, but i have a problem understanding what a Model is and what it should contain. ...
2
votes
1answer
78 views

Which is more secure for the DB, Web API or MVC with repository pattern & EF?

I am 1 of 3 developers. The other 2 use Web API and angular to build web apps. I prefer ASP MVC with a repository and EF. The stated argument is that a service is more secure when accessing the ...
3
votes
4answers
392 views

Using Structs to organize code

I recently ran across some code during a review that baffled me a bit. The dev was using structs to organize code within a larger file. I personally don't like the practice but wanted to hear others ...
1
vote
1answer
157 views

MVC and use of partial class for Controller

I have a webpage and frontend contains pages for Customer, Product and Order part and other parts may be added. The actual implementation is that every part(modul) has its own Controller and every ...
0
votes
1answer
94 views

How to create a single login service to use it in multiple sites ? (similar to Google, Microsoft Account)

I want to implement login system where same user account can be used to login in different web applications. How can I achieve this ? I want to make a similar architecture to Google and Microsoft ...
0
votes
0answers
59 views

ASP.Net MVC 5 Identity Questions

So I have been learning ASP.Net MVC along with Entity Framework from database first perspective. The identity framework that is included in the project templates looks very interesting and will save ...
0
votes
0answers
40 views

Use MVC Identity from other Application

I want to create a logon system, using WebAPI2. I also have a MVC4 application which I want to upgrade to MVC5 without changing too much straight away. I was wondering if it was possible to point the ...
1
vote
1answer
84 views

Adding support for privileges to an ASP.NET MVC application already supporting roles based authorization

I currently have a system where there is a user table, a role table, and a user-roles association table, where one user can be associated to multiple roles (like Admin, BasicUser, etc.). I am able to ...
-2
votes
1answer
114 views

Why C# ASP.NET MVC Code First POCO Classes must have getters and setters?

Why in, C# ASP.NET MVC Code First project, POCO Classes must have getters and setters ( {get; set; } ) in order to work? public float data { get; set; } or in db context class public DbSet<SGD....
0
votes
0answers
32 views

Maintaining ASP.NET MVC Data Encrypted

I am working on an ASP.Net MVC Solution. It has some sensitive data that I am trying to maintain as secured as possible. on my data layer I am able to encrypt the data. Currently I have the controller ...
0
votes
1answer
83 views

Questions regarding my MVC application

I'm learning .net MVC while developing a simple word list - Eg. When you learn a new language and create a list of words related to a certain topic. I don't think I'm following the rules or good ...
1
vote
1answer
145 views

Consume ASP.Net REST API service

I am creating ASP.Net REST API application and stuck on the part where I should consume the REST service. I am not sure how to find the way let me accomplish the following: 1. I don't want it to be ...
4
votes
1answer
56 views

Two MVC projects(API and Web), should ViewModel be in a common library or in each project?

I'm creating a .NET MVC solution that will have two web projects, one for API and for Web. Some models, such as customer, will be the same between the two projects. Is it best to have them kept in a ...
1
vote
0answers
52 views

How to deal with weekly schema updates on database production server? (ASPNet MVC and Entity Framework)

I'm working with scrum methodology. thus weekly schema updates are performed to the final product. However our customer is already populating the database. How can I update the database without ...
0
votes
1answer
163 views

How Common/Acceptable is it for a .NET developer to abstain from WebForms as a rule? [closed]

I work at a mostly .NET shop. A coworker has more of a background in open-source MVC (think RoR and Spring MVC). She seems to really enjoy .NET MVC, but she practically refuses to work on Web Forms, ...
-2
votes
1answer
87 views

Controllers and Separation of Concerns: discussing possible strategies

I've been working on a project based off of this tutorial. Unfortunately, the controller classes in this are quite dense and have terrible separation of concerns. I should have realized this ...
5
votes
1answer
370 views

is “ASP.NET Membership” still a good choice for ASP.NET MVC authentication nowdays?

The last time I used asp.net 4 years ago, the "ASP.Net Membership provider" was the best way to do user authentication in an ASP.Net application. Nowadays, is using the "ASP.Net Membership provider" ...
0
votes
1answer
50 views

How do I handle the potential concurrency problem of making a payment to Paypal for a limited number of items?

After doing some investigation* I have learned that I could potentially have a concurrency problem. I'm currently building a Tournament Platform in ASP.NET MVC 5 with Entity Framework 6. So far, I'...
4
votes
7answers
788 views

Should I use static classes for methods that will do common tasks and would be called through out my application?

I have spent the last few hours reading up on the use of static classes and trying to figure out if I should be using them or not but still have not come to any sort of conclusion. It seems that the ...
0
votes
1answer
83 views

How to have server call a web page for data on a timer

My question is not how to call a web page in code but rather what the correct architecture for it would be. I have an MVC web app that displays certain data from our database when the user visits a ...
0
votes
1answer
217 views

Dependency injection multiple instances or only one InrequestScope

I'm trying to understand what happens with dependencies (Ninject) when a same Interface in injected in multiple classes. I am specifying InRequestScope for my bindings so as I understand there should ...
0
votes
3answers
133 views

My ASP.NET MVC controllers seem like in mess

I am developing program with asp.net MVC and I feel like I'm doing it wrong in these parts: I'm populating all process in controller, because I don't know how to put it in model (how to call it). I ...