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

learn more… | top users | synonyms

3
votes
0answers
201 views

Identity Design ASP.NET

I am trying to design a system with the below features, and am currently trying to figure out best way to handle Identity : There will be multiple decoupled parts of the system, with same customers ...
0
votes
1answer
333 views

common infrastructure for web apps using asp.net mvc

How to build a common infrastructure for my web apps using asp.net mvc, and efficiently manage it? The goal is to increase developer productivity. The common infrastructure stuff includes visual ...
3
votes
2answers
561 views

Encapsulation in Domain Driven Design models?

I am using EF Code First and I had a model like below. public class Account { [Required] public string AccountNo { get; set; } [Required] public decimal Balance { get; set; } } I ...
4
votes
2answers
2k views

How to structure a modern web application

Background I recently developed, for two different projects, two web applications. The two followed quite different approaches. The first one was a classic inventory application (lists of stuff to ...
2
votes
4answers
1k views

What is the value of OOP in ASP.NET MVC?

As a C++ developer from the 90s during the great OOP wars, I put high value to OOP as a basis for hiring new C# developers into the company. However, there are plenty of frameworks today like ASP.NET ...
1
vote
1answer
229 views

Best way for an external (remote) graphics designer to style ASP.NET MVC 4 app?

My customer has his own graphics designer he wants to use to style his web application we're building in ASP.NET MVC 4. Our solution is in Bitbucket, but if he can't run it what choices do we have? ...
0
votes
1answer
321 views

Provide multiple SendCompleted callbacks to SmtpClient

I have an Email class that has a Send method that optionally takes an SmtpClient and sends an email asynchronously using SendAsync. If no SmtpClient is supplied to this method, it instantiates a ...
1
vote
1answer
292 views

Is there a setting to enable anti forgery globally in ASP.NET MVC, and if not, why?

The tutorials I've read tell you to use [ValidateAntiForgeryToken] attributes and <%= Html.AntiForgeryToken() %> in your code. I was wondering why this isn't a built-in automatic setting or at ...
2
votes
1answer
435 views

Creating a site just for URL redirecting (.NET MVC) due to changing domains and URLs

I'd just like to hear about any experience creating a (simple) site for redirecting requests. Basically we have multiple domains, but as we add more domains and change URLs, there is a huge problem ...
2
votes
1answer
435 views

In what situations will Windows-based authentication for my ASP.NET MVC web application fail to allow users from accessing the web application?

My requirements are: To build an ASP.NET MVC web application to use Windows-based authentication, since all the users which will be accessing the application are our internal employees, and they ...
0
votes
1answer
317 views

View is calling constructor method in the Model instead of passing model to the controller method

The problem is the UserTypes property (used to populate a drop down list in the AddUser view) is not being retained after POSTback of the form. Here is my AddUserModel: (which inherits from ...
0
votes
1answer
257 views

Asp.Net MVC Windows authentication - vulnerabilities of http vs https?

I am developing an ASP.Net MVC 3 intranet site that will use Integrated Windows Authentication exclusively. What are the vulnerabilities of the challenge/response authentication traffic being sent in ...
1
vote
2answers
2k views

Anemic Domain Model vs. DDD by definition example(s)?

What is an example of "Business Logic" that should reside in the DomainModel i.e. inside an Entity instead of inside a (Domain) Service, as well as some example logic that should be in a service. ...
2
votes
1answer
772 views

DDD/SOA in (.NET) MVC and Message pattern(s) / Request Response

We're currently considering whether it makes sense (or if the benefits are worth the added code) to introduce a Message based pattern (such as Request Response) into a Domain Driven Design / Service ...
1
vote
2answers
240 views

The Proper UML Model of a System for Non-Technical Boss

I've taken on some side work for this non-profit and last week was my first week on the job. They have two SQL Server Databases each with many tables in them that represent over 20 different ...
1
vote
1answer
687 views

How do I split out a service layer

I currently have four projects in my website's solution: Project.Data This holds the EntityFramework DbContext object and also the Repositories that interact with it. It references Project.Models. ...
3
votes
1answer
132 views

MVC URL formatting/design

In refactoring a lot of MVC code, I have run into an issue with my URL design. For example, let's say we have a Venue object public class Venue { public long ID { get; set; } public ...
5
votes
3answers
1k views

Versioning an API

I'm starting a side project, the first stage will be a building a web application with MVC, in later stages we will be adding clients for mobile platforms. My thought was to create one API that all of ...
2
votes
2answers
660 views

MVC : Does Code to save data in cache or session belongs in controller?

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...
4
votes
6answers
395 views

Is MVC ever considered/applied system-wide?

I was having a discussion with a colleague and he bought up the topic of MVC and the use of ViewModels in ASP.NET MVC. The discussion was that, in an n-layer architecture, the UI, Business Layer and ...
6
votes
6answers
2k views

How do I make my ASP.NET application take an action based on time?

I have an ASP.NET MVC4 application. Suppose that I wanted to execute some code (such as emailing a user) 2 days after a user has signed up. One way is to have code executed on every request which ...
9
votes
4answers
802 views

In Unit Testing, why would I create a Repository twice?

The other day I was reading a little about Unit Testing and I saw some examples where people create a repository interface (i.e. IExampleRepository) and then create the real repository (public class ...
9
votes
3answers
8k views

Why should I use List<T> over IEnumerable<T>?

In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation. Return IEnumerable(Of Student) vs Return New List(Of ...
9
votes
4answers
2k views

What's the best practice for naming uploaded images?

Suppose I have a form in my web application where users can upload a profile picture. I've got few requirements about file size, dimensions etc, but when the user uploads the image, how should I name ...
2
votes
4answers
740 views

Querystring Advanced Search where there are about 20 search fields

I am creating an advanced search page where there are about 20 search fields for a user to filter their search. My question deals with the query string, Is it standard web development practice to have ...
3
votes
3answers
2k views

Reuse MVC4 codebase / deploy MVC4 as standalone desktop application?

We have an MVC4 application that we would also need to distribute as a standalone (no network connectivity) desktop application. Rather than rebuild the HTML/JS front-end we would like to reuse that ...
1
vote
0answers
242 views

Reusing values for segment variables when generating outbound URLs

When routes are matched to the outbound URLs, the routing system will try to find values for each of the segment variables in route's URL pattern by also looking at the values from the current ...
1
vote
2answers
2k views

Asp MVC section and partial views

I have a question regarding ASP sections and partial views. What ser the benefit of using one over another? Because if I have a menu, i guest that it could be both as a section, but also as a ...
6
votes
2answers
614 views

Why is using named routes for generating outbound URLs a violation of Separation of Concerns?

What is separation of concerns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little ...
0
votes
1answer
208 views

Streamlining ASP.Net MVC deployment? [closed]

I own a VPS with Windows Server 2012 on it. I can install whatever I want on it. In the past when deploying an ASP.Net MVC project, I would right click the project in the solution and Publish it. I ...
13
votes
3answers
3k views

Is there any real value in unit testing a controller in ASP.NET MVC?

I hope this question gives some interesting answers because it's one that's bugged me for a while. Is there any real value in unit testing a controller in ASP.NET MVC? What I mean by that is, most ...
1
vote
1answer
395 views

UTF-16 Pitfalls, Chinese

I'm going to be writing an application that is pure HTML5 and JS and MVC.net back-end. We have .resx files that are getting compiled to .js files for resources in the html5 application. The ...
4
votes
2answers
554 views

How do I handle having so many SQL queries?

I have an MVC3 project that uses SQL Server. I use data from the SQL database all the time and I often find that I'm reusing/duplicating some SQL queries. I thought I'd solve this problem by creating ...
0
votes
3answers
359 views

Re-engineering an ASP.NET AJAX project as ASP MVC

I have been asked to investigate the possibility of re-engineering an existing ASP.NET AJAX Web Application as under MVC. The project, as it stands ATM, is very heavily relient on Telerik's ASP.NET ...
0
votes
1answer
435 views

Implementing a Service Layer with MVC4 while honoring Single Responsibility

I'm trying to learn some best practices while I ramp up on MVC4. I have a solution with three projects: Web: MVC stuff Core: Data Model Tests: Testing classes I'm now trying to add: Services: ...
35
votes
1answer
3k views

Why does the .Net world seem to embrace magic strings instead of staticly typed alternatives?

So, I work in .Net. I make open source projects in .Net. One of my biggest problems with it isn't necessariyl with .Net, but with the community and frameworks around it. It seems everywhere that ...
0
votes
2answers
314 views

Which asp.net technology fits this situation best?

I think I can count WebAPI out, but WebForms, WebPages, and MVC are all possibilities. I want to create an asp.net web site that is primarily static content and links to other sites. The only ...
3
votes
2answers
862 views

What .NET objects should I use to create a cookie based session in MVC?

I'm writing a custom password reset application that uses a validation technique that doesn't fit cleanly with ASP.NET Membership Provider's challenge questions. Namely I need to invoke a workflow ...
3
votes
5answers
1k views

MVC exposes database primary keys?

I'm going through a MVC tutorial, and I notice that convention seems to be to expose a tables primary key on detail pages/urls (ie. /Movies/Details/5 as an example from the tutorial). It's obviously ...
7
votes
3answers
5k views

How to make an ASP.NET MVC site modular

I'm in the planning stage for an employee intranet system to be built with ASP.NET MVC 4. We'd like the site to consist of separate "modules", each of which provides a different feature: messaging, ...
1
vote
1answer
606 views

MVC 3 Page design; split pages into Many partials?

I am currently working on an MVC 3 Web app project where I need to display a lot of information on the front page. I am relatively new at web page layout and design so I have hit a wall in terms of ...
2
votes
1answer
670 views

Newbie ASP.NET developer being forced into MVC4 with WebForms

I recently got hired on as a new ASP.NET developer (C# code behind). When I arrived, I was told that they were moving to MVC 4, and so I bought two books on that. However, the other day I learned ...
4
votes
4answers
4k views

What does this mean: Expression<Func<TModel, TValue>>

In ASP.Net MVC, in the razor view, you can type this kind of code: @Html.EditorFor(model => model.Name) (in this case, it creates a textbox for the field Name of the object which is defined as ...
1
vote
2answers
409 views

Want some architecture input to help with current requirements and future (unknown) requirements :-)

BACKGROUND: I am starting to architect a web project using asp.net mvc. I'm going to use a very common architecture where I have the following layers: Service Biz Data Domain The Service layer ...
2
votes
2answers
313 views

Different Project Type in a Single Website

I have developed a website in asp.net and I have some additional tasks, improvements to develop. In order to get experience in asp.net/mvc, I want to create an admin panel using asp.net mvc. Is this ...
3
votes
1answer
901 views

How to create view models - Constructor, Factory Method, …?

I'm trying to lead a charge for re factoring our rather bloated controllers. We currently have a BaseModel from which all our other models inherit. The BaseModel contains things common to all pages, ...
1
vote
1answer
151 views

Good resources for a MVC.Net developer going back to WebForms? [closed]

Well it looks like I may be forced to build a new system in webforms after having worked exclusively in MVC for the last 3 years. Initially I didnt think this was going to be a problem except the ...
3
votes
2answers
1k views

Different database for Membership and our web data or use just one?

Is better to keep our Membership stuff on the DefaultConnection and create another connection (another database) for our data? Or just one database for all? If I have a MyAppContext and I want ...
39
votes
6answers
23k views

Why shouldn't I use the repository pattern with Entity Framework?

During a job interview, I was asked to explain why the repository pattern isn't a good pattern to work with ORMs like Entity Framework. Why is this the case?
0
votes
1answer
349 views

Get/Post Controller Logic Best Practice

In an ASP.NET MVC project (Razor), I have a Get request, which loads two properties on a model, dependent on the property passed into the action method. So if the parameter has a value, the Group ...