asp.net - Using a different viewmodel in partial view using Spark view engine -
using asp.net mvc & spark, have view listing number of searches. view has following declaration @ top:
<viewdata model="ienumerable<searchmodel>" />
on same search page, render partial used content of popup window enables users add new searches.
my problem is: in partial view want make use of typed html helpers , write:
${html.textboxfor(model => model.searchphrase)}
but when add another:
<viewdata model="createsearchmodel" />
at top of partial view file, spark fails only 1 viewdata model can declared.
i can use normal html helpers, how might benefit of using typed html helpers in partial view - or there better way of doing this?
instead of <use file="partial"/> try
# html.renderpartial("partial", mydata);
this should workaround single model limitation.
Comments
Post a Comment