ASP.NET MVC: Redundant (strongly typed) views in CRUD areas.

Posted by UpTheCreek on Stack Overflow See other posts from Stack Overflow or by UpTheCreek
Published on 2010-06-11T09:05:30Z Indexed on 2010/06/11 13:02 UTC
Read the original article Hit count: 150

Filed under:

In the CRUD areas of my MVC app I have lots of seemingly pointless view files, such as:

<%@ Page Title="" Language="C#" MasterPageFile="Some.Master" Inherits="System.Web.Mvc.ViewPage<SomeModel>" %>

<asp:Content ID="ContentID" ContentPlaceHolderID="SomePlaceHolder" runat="server">
   <%= Html.DisplayForModel() %>
</asp:Content>

This is of course pretty unDRY.

Is it possible to use a shared view for this while at the same time preserving the Strong Typing? (e.g. by specifying the generic type in the controller?)

© Stack Overflow or respective owner

Related posts about asp.net-mvc