ProfK,
Here is what I tried (VS 2010, MVC2):
public class ViewDataBase
{
public int ID { get; set; }
public string Name { get; set; }
}
public class CustomerViewData : ViewDataBase
{
public string Address { get; set; }
}
Right clicked on my Action and created a strongly typed Details view using CustomerViewData. The following gets generated:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MyApplication.Models.CustomerViewData>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Index</title>
</head>
<body>
<fieldset>
<legend>Fields</legend>
<div class="display-label">Address</div>
<div class="display-field"><%: Model.Address %></div>
<div class="display-label">ID</div>
<div class="display-field"><%: Model.ID %></div>
<div class="display-label">Name</div>
<div class="display-field"><%: Model.Name %></div>
</fieldset>
<p>
<%: Html.ActionLink("Edit", "Edit", new { /* id=Model.PrimaryKey */ }) %> |
<%: Html.ActionLink("Back to List", "Index") %>
</p>
</body>
</html>