I'm just wondering what the best practice would be for the following
situation.
I have a view which renders a partial view and defines some viewdata.
<viewdata product="Product" />
<div>
<use file="my-partial-view" />
</div>
The partial view looks like this:
<viewdata product="Product" />
...view contents...
That gives me a compilation error because there are now two product
properties defined in the generated class. So, I have to get rid of
the <viewdata product="Product" /> in the partial file.
However, I also use that partial file as the rendered view for an ajax
request. So, during the ajax request, that view compilation fails
saying that there is no member 'product' defined.
What would be the best way to accomplish what I am trying to do?
Ideally, I'd like to keep the <viewdata product="Product" /> in both
files and just have Spark be smart enough to only generate the
property in the class one time. Or maybe Spark should generate a
separate class file for each view (rather than merging partial views
with their parents) so that clashes like this won't happen?
(Lou)
Having Spark de-duplicate would be very simple. It could throw an
exception if the types don't match.