Tagged Questions

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

learn more… | top users | synonyms

4
votes
5answers
2k 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 ...
9
votes
3answers
6k 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
651 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
699 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
5k 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
441 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
320 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
1k 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
158 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
2k 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 ...
41
votes
6answers
25k 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
411 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 ...
1
vote
2answers
774 views

Implement service layer in MVC

We have a defined service layer hosted in WCF. We are now building a website that will need to use the services functionality. The website is being written in ASP.NET MVC 4 and I'm trying to decide ...
2
votes
1answer
196 views

Is passing the Model around in this way considered bad practice?

If I have a view called, for example, ViewDetails that displays user information in labels and has a Model called ViewDetailsModel and if I want to allow the user to click a button to edit some of ...
1
vote
1answer
259 views

Unit test: How best to provide an XML input?

I need to write a unit test which validates the serialization of two attributes of an XML(size ~ 30 KB) file. What is the best way to provide an input for this test? Here are the options I have ...
5
votes
1answer
1k views

Project/DLL separation of concerns in ASP.NET MVC

I'm coming from a web forms n-tier background into ASP.NET MVC projects, and I'm wondering what the best practices are for separation of the components of MVC into different libraries (or not to) in ...
0
votes
2answers
605 views

MVC or Extract Service Layer

we have an application that is built with .Net MVC. We are now tasked with exposing API's to third parties. Members on our team want to just continue down our current path and just use more ...
3
votes
1answer
2k views

ASP.NET MVC Portable Areas - Can they communicate and be used as a plugin-like architecture?

I'll get straight to the point: I was wondering if there is a common pattern to use portable areas as a components of a plugin-like architecture. Example: We've got 3 plugins (portable areas) ...
2
votes
1answer
3k views

Modular enterprise architecture using MVC and Orchard CMS

I'm making a large scale MVC application using Orchard. And I'm going to be separating my logic into modules. I'm also trying to heavily decouple the application for maximum extensibility and ...
9
votes
3answers
4k views

How should I implement the repository pattern for complex object models?

Our data model has almost 200 classes that can be separated out into about a dozen functional areas. It would have been nice to use domains, but the separation isn't that clean and we can't change it. ...
2
votes
1answer
554 views

ASP.Net MVC 3: multiple versions of the site without changing of URL, is it possible?

Our website is written in ASP.NET MVC 3 and we want to change a feature in the core functionality of the site. The problem is not every client can be moved to this new version/format (because of ...
2
votes
1answer
2k views

.Net C# Remote Method Invocation (RMI) (Client/Server communication)

What exactly is C# version of Java RMI? I want to invoke the methods of client from the server, ping the client from server etc. How the server and client communication is done with c#?
1
vote
2answers
230 views

Is it better to define all routes in the Global.asax than to define separately in the areas?

I am working on a MVC 4 project that will serve as an API layer of a larger application. The developers that came before me set up separate Areas to separate different API requests (i.e Search, ...
4
votes
2answers
633 views

Is ASP.NET MVC completely (and exclusively) based on conventions?

--TL;DR Is there a "Hello World!" ASP.NET MVC tutorial out there that doesn't rely on conventions and "stock" projects? Is it even possible to take advantage of the technology without reusing the ...
-2
votes
2answers
810 views

ASP.NET MVC Controller separation best practices [closed]

I am very new in ASP.NET MVC and Web stuff. I want to know how I should separate my page logic into different controllers. Like for example should I use Home\BuyProduct or Product\Buy. When there is a ...
7
votes
4answers
740 views

Unit testing and Test Driven Development questions

I'm working on an ASP.NET MVC website which performs relatively complex calculations as one of its functions. This functionality was developed some time ago (before I started working on the ...
1
vote
1answer
512 views

Webservice Return Generic Result Type or Purposed Result Type

I'm building a webservice which returns JSON / XML / SOAP at the moment.. and I'm not entirely sure which approach for returning results is best. The Client Consuming the Services will generally be ...
2
votes
1answer
552 views

What benefits can I get upgrading my ASP.NET (Webform) + DAL(EF) + Repository + BLL structure to MVC?

I'm in the process of defining an approach that may best fit our needs for a big web application development. For now, I'm thinking going with an ASP.NET Architecture with a DAL using Entity ...
0
votes
3answers
1k views

How to build MVC Views that work with polymorphic domain model design?

This is more of a "how would you do it" type of question. The application I'm working on is an ASP.NET MVC4 app using Razor syntax. I've got a nice domain model which has a few polymorphic classes, ...
2
votes
2answers
634 views

Sending an email with attachment from server side

I have to create a word document in a specific format and send it as attachment to some email addresses. I have a preview screen for the report which on approval has to be send in email. This is an ...
2
votes
2answers
558 views

Is this the correct way to implement .NET MVC website structure?

I have recently seen a .NET MVC solution in which the markup in the .aspx views which appear to have a Controller as their model i.e the controller seems to be providing the data for the view, and the ...
2
votes
2answers
638 views

MVC, when to separate controllers?

I'm starting with MVC and have a newbie question. What would be the logic criteria to define what a controller should encompass? For example, say a website has a 'help' section. In there, there are ...
2
votes
1answer
2k views

Port numbers in Visual Studio projects and IIS

I have a few questions about localhost and port numbers as this is an area where I do not have a lot of knowledge, and because I recently had to work with setting up Visual Studio projects and IIS and ...
5
votes
3answers
263 views

What exactly do I have to pay attention for when choosing Windows Hosting Provider?

This is my first time choosing a hosting company. It is for a web site made in asp.net mvc3. So I was thinking choosing a provider would be easy since I found this page ...
0
votes
2answers
921 views

Wrapping REST based Web Service

I am designing a system that will be running online under Microsoft Windows Azure. One component is a REST based web service which will really be a wrapper (using proxy pattern) which calls the REST ...
-2
votes
2answers
5k views

What is dependency of ASP.NET MVC on .NET Framework and how to use it with .NET 2.0?

When you download and install asp.net MVC, does it just add code to the .net framework class library? Or does it also modify the installed Visual Studio editions? Another question: If it is just ...
4
votes
4answers
2k views

How do you deploy your ASP.Net MVC3 application to the production server?

I just want to find out the best practice to deploy your MVC3 application and what tool you use to get the job done. I am using Visual Studio 2010. I publish my web site, then manually backup whats ...
3
votes
2answers
1k views

What are the differences between Castle Monorail 3 over ASP.Net MVC?

I have been using Castle Monorail for some years now with great success, although I haven't bothered to update the version I'm using (2 or 3 year old). Now I'm making a decision on go to ASP.Net MVC 3 ...
0
votes
1answer
1k views

Database Driven Web Application, C# Front-End and F# Back-End meaning

Hi I am an intern working with ASP.NET. My current task is to make a website which will incorporate some jquery viewing features. This project seems to me will be primarily dealing with reading data ...
7
votes
3answers
2k views

IValidatableObject vs Single Responsibility

I like the extnesibility point of MVC, allowing view models to implement IValidatableObject, and add custom validation. I try to keep my Controllers lean, having this code be the only validation ...
4
votes
3answers
213 views

Bringing in New Architecture During Maintenance on Legacy Systems

I have been tasked with adding some new features to a legacy ASP.NET MVC2 project. The codebase is a disaster and I want to write these new features with some thought behind the implementation and not ...
1
vote
1answer
826 views

Flash messages in ASP.NET MVC without sessions

I'm developing a web application for Windows Azure using ASP.NET MVC 4. I would like to enforce one restriction in the architecture: do not use Session. To achieve availability on Azure, and since ...
0
votes
2answers
428 views

Generic Handler vs Direct Reference

In a project where I'm working on the data access layer I'm trying to make a decision how to send data and objects to the next layer (and programmer). Is it better to tell him to reference my dll, ...
1
vote
1answer
2k views

Using WebStorm for Razor Syntax MVC

I am building a lot of client-side heavy SPA-like apps with VS2010 and MVC3/4. VS2010 Javascript/HTML/CSS editing (mostly javascript) is interminably slow and sluggish. I'd love to use something ...
14
votes
3answers
9k views

ASP.NET MVC vs WCF for REST API + Webpage usage

I think the discussion for programmatic service oriented usage vs human interaction is clear. But if I were to create an application that makes use of both a programmatic API and a website that makes ...
10
votes
1answer
2k views

Is there a need for a factory class for creating viewmodels?

A colleague of mine suggested using a factory class for creating viewmodel objects in our ASP.NET MVC solutions. The idea being that it can help with the design, and maintainability, of the way ...
1
vote
2answers
248 views

What are some useful things you can do with Mvc Modelbinders?

It occurs to me that the ModelBinder mechanism in ASP MVC public interface IModelBinder { object BindModel(System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext ...
9
votes
1answer
2k views

How to build a good service layer in ASP.NET?

I have looked through some questions, technologies for building a good service layer but I have some questions regarding this that I need help with. First some information of what I have for ...
3
votes
2answers
774 views

Storing images in file system and returning URLs or virtually resizing and returning byte arrays?

I need to create a REST web service to manage user submitted images and displaying them all in a website. There are multiple websites that are going to use this service to manage and display images. ...
1
vote
3answers
882 views

Can you/should you develop components for ASP.NET MVC?

Following from the previous question I've started to wonder - is it possible to implement "Components" in ASP.NET MVC (latest version)? And should you? Let's clarify what I mean with a "component". ...