Relative Content

Tag Archive for asp.net-mvc

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 these details, is it considered bad practice is I pass the entire Model in the markup to a controller method which then assigns the values for another model, using the values stored in the Model that was passed in as a parameter to that action method? If so, should there instead be a service method that gets the data required for the edit view?

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 how to reference the WCF service from the MVC app. It’s a large complex website and it will be changing on a weekly basis.

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 property is supplied data. But if not, the Groups collection property is supplied data.

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, such as the page title, css files needed, current user.

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.

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 how to structure the code behind for this page.

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, payroll changes, etc. I’d like these modules to be able to be enabled or disabled at compile time. The homepage will display some kind of navigation that will link to each module that is loaded.

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).