I have an OrderForm
domain class, which has property subclasses, something like:
interface IOrderForm
{
int OrderId { get; }
ICustomerDetails CustomerDetails { get; set; }
IDeliveryDetails DeliveryDetails{ get; set; }
IPaymentsDetails PaymentsDetails { get; set; }
IOrderDetails OrderDetails { get; set; }
}
My "Details" view is strongly typed inheriting from IOrderForm
. I then have a strongly type partial for rendering each section:
<div id="CustomerDetails">
<% Html.RenderPartial("CustomerDetails", Model.CustomerDetails); %>
</div>
<div id="DeliveryDetails">
<% Html.RenderPartial("DeliveryDetails", Model.DeliveryDetails); %>
</div>
... etc
This works ok up to this point, but I'm trying to add some nice ajax bits for updating some parts of the order form, and I've realised that each of my partial views also needs access to the IOrderForm.OrderId
.
Whats the easiest way to give my partials access to this value?