Questions tagged [asp.net-mvc-4]

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

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

New Features

Among the new features of the fourth release are:

  • Refreshed and modernized default project templates
  • New mobile project template
  • Many new features to support mobile apps
  • Enhanced support for asynchronous methods
  • ASP.NET Web API for HTTP services

Read the full feature list in the release notes

Resources

61 questions
41
votes
3 answers

Should we call Web API from MVC application in same solution?

I am working on a project in MVC that has mobile application so one thing is clear that we have to use Web API so it can used in mobile application. After creating API when we started to develop Web site we are confused and had discussion on whether…
18
votes
4 answers

Utility Classes in MVC - ASP.NET

So I was wondering today, where would you put utility classes in an ASP.NET MVC app? By utility classes I mean classes that can be static and are just used to perform a function. Like a class to send an email that takes email address , subject, and…
user60812
  • 401
  • 1
  • 3
  • 11
15
votes
5 answers

What exactly is "Web API" in ASP.Net MVC4?

I know what a Web API is. I've written API's in multiple languages (including in MVC3). I'm also well practiced in ASP.Net. I just discovered that MVC4 has "Web API" and without going through the video examples I can't find a good explanation of…
James P. Wright
  • 2,135
  • 4
  • 18
  • 25
12
votes
3 answers

WCF Data Services (OData) Vs ASP.NET Web API? Hypermedia?

I'm desiging a distributed application that will consist of REST services and a variety of clients (Silverlight, iOS, Windows Phone 7, etc). I was ready to decide that I would implement my REST services using WCF Data Services (OData) but now the…
Raymond Saltrelli
  • 1,344
  • 2
  • 12
  • 16
11
votes
1 answer

Is Code First with Migrations or SQL Server Data Tools a better fit?

I have been given a spec to create a new MVC4 website, it will not be too large a project at first but I suspect it will grow as the business gets new ideas for it. Using .NET 4.5 ASP.NET MVC4 and EF I have to choose between code-first with…
Lotok
  • 1,759
  • 2
  • 17
  • 27
8
votes
1 answer

when is it necessary or when should a controller be async

When is it absolutely necessary for a controller to be async? Should all controllers be async or is it bad practice to make all of them async unless it is necessary. Just looking for some general guidelines.
SOfanatic
  • 241
  • 2
  • 9
7
votes
2 answers

Domain Model vs View Model

I'm in the early stages of my programming career and I've been working with MVC for just about a year now. I've spent much time learning about the pattern and the concepts behind it, but as the projects I'm working with get larger I'm starting to…
aw04
  • 201
  • 3
  • 7
7
votes
1 answer

Why should I use Iesi.Collections instead of the traditional System.Collection?

Was research on how (for convetion) define a Many Many where table where both fields are primary key and found this post. So decide to install the Iesi.Collections in my library domain. But there came a doubt. In the "Iesi.Collections" outperforms…
ridermansb
  • 225
  • 2
  • 9
7
votes
3 answers

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 the applications (web and mobile) go through to…
5
votes
2 answers

Why does a custom action filter need to inherit from both ActionFilterAttribute and IActionFilter?

I m first time creating a custom action filter and following this link http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters They are saying to Extend ActionFilterAttribute class and also implement…
user576510
  • 211
  • 3
  • 6
5
votes
1 answer

why Web API 2 has RouteConfig.cs file?

I m working on Web API project, and it is using WebApiConfig.cs file to defined routs for Web API. Web API fold RouteConfig.cs file. I have googled and they say RouteConfig.cs is for MVC routing. It is actually a confusing statement. Can you please…
user576510
  • 211
  • 3
  • 6
5
votes
1 answer

Controlling cookies with many tabs

I have a peculiar problem. My application has different levels of authentication. One specific level of user (super user) needs to be able to use the application as another user (subordinate user) that has lower privileges. We decided that when the…
4
votes
2 answers

Authorisation and Authentication in a DDD application

Consider a website like: Confused.com, which is a price comparison website that has millions of registered users who use it for price comparison purposes. These users register their details for price comparison purposes? How do you deal with…
w0051977
  • 7,031
  • 6
  • 59
  • 87
4
votes
1 answer

When starting a new ASP.NET application, what changes when I change from .Net 4.5 to 4.6.1 and why is 4.5 the default?

Using Visual Studio 2015 update 2, creating a new ASP.NET 4.x application, the default .Net "Target framework version" is 4.5. Is it a mistake to bump this to 4.6? I did my own research, and I am unclear. It seems to me, that if .Net 4.6.1 is the…
Warren P
  • 830
  • 5
  • 14
4
votes
2 answers

Use model for “everything” in MVC?

This question is a result out of the discussion HERE and was moved from HERE. Is it really good practice to supply EVERY value you display in any view via a model? Especially variables like the current username. Even Microsoft odes the following in…
1
2 3 4 5