Dynamically set the view base type for a partial view?

0 views
Skip to first unread message

Kieron

unread,
Jul 12, 2010, 6:24:59 AM7/12/10
to Spark View Engine Dev
Hi,

Is it possible to dynamically set the view base type for a partial
view?

I'm doing a lot of dynamic page generation, using custom IViewFolder
and IViewFile implementations, and need to set a specific base type
for certain views...it's not a problem injecting the correct block, I
just need to know what block to inject.

I've tried:

<use pageBaseType=”MyCustomViewType” />

at the top of the partial view, but it doesn't get picked up...is that
the right syntax? Is it even possible...?

Thanks in advance,
Kieron

Guillaume

unread,
Jul 12, 2010, 11:27:52 AM7/12/10
to Spark View Engine Dev
Hi,

I think partials don't translate to classes, they just get injected
into the views.

I'm not sure about this, but you can check in Spark source code ;).

I'd like to do something like that in the future (for a CMS) so I'm
also interested by that issue.

Guillaume

Adam Schroder

unread,
Jul 12, 2010, 6:41:37 PM7/12/10
to spar...@googlegroups.com
This would probably work if you called the partial with Html.RenderPartial("_partial") and not with the inline <partial/> syntax.

--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.


Kieron

unread,
Jul 13, 2010, 5:26:41 AM7/13/10
to Spark View Engine Dev
Hi all, thanks for the responses - in the end I had to inject some
<var PROPERTYNAME="VALUE" /> tags into the code to get the customised
results I needed. It's not ideal, but it works.

Guillaume, you're right, partials don't translate to classes, like the
Web Forms view engine partial representations, they just get injected
into the main view in the right place.

Thanks all.
Reply all
Reply to author
Forward
0 new messages