My first step is to create a view model. Even if this is very similar to your actual entity, the separation is important. so I would create a ProductEditViewModel
class.
Next, determine the properties that will be changing based on the different product types. Create separate Partial View Models for each product type. This allows you control over what properties are displayed and how they are formatted.
In your main Product Edit view, use a switch statement to "swap in and out" the different partial views, as required. If you use AJAX, you can even do this dynamically.
In this example, we have a number of different reports that have different report types. The main part of the reports doesn't change, just a number of different parameters (depending on type).
For each report type we have separate partial views, which you can see are added in depending on the report type. This code snippet is inside a <% using (Html.BeginForm()) %>
code block.
<% switch (Model.ReportType)
{
case (int)ReportType.summary:
Html.RenderPartial("Edit/SummaryControl", Model);
break;
case (int)ReportType.exception:
Html.RenderPartial("Edit/ExceptionControl", Model);
break;
case (int)ReportType.leakdetection:
Html.RenderPartial("Edit/LeakDetectionControl", Model);
break;
} %>
and the summary report partial view:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Footprint.Web.ViewModels.ReportsEditViewModel>" %>
<fieldset>
<legend>Summary Report Parameters</legend>
<div class="editor-label">
<%= Html.LabelFor(model => model.Frequency)%>
</div>
<div class="editor-field">
<%= Html.DropDownListFor( model => model.Frequency,Model.Frequencies) %>
<%= Html.ValidationMessageFor(model => model.Frequency)%>
</div>
<div class="editor-label">
</div>
<div class="editor-field">
<%= Html.CheckBoxFor(model => model.Combine) %><%= Html.LabelFor(model => model.Combine)%>
</div>
</fieldset>
HTH