master partial convention

0 views
Skip to first unread message

Mike Nichols

unread,
Jun 24, 2010, 12:11:47 PM6/24/10
to Spark View Engine Dev
I am trying to apply a convention where if a file '_Cmd' exists in a
controller's folder, it is rendered as a sidebar in the master
layout.

I have tried this in my application.spark layout:
<div id="cmd"><use content="cmd"><Cmd/></use></div>

But this does not look in the controller folder (views/<controller>).

This does work:
<div id="cmd">
<use content="cmd">
# Html.RenderPartial("_Cmd",new object());
</use>
</div>

How can I have the master layout look in the current controller folder
path for partial views? I can see this as a convention that will be
used again and I'd prefer not using code in the view directly. Is
there a better approach for this kind of convention?

Rob G

unread,
Jun 25, 2010, 4:55:25 AM6/25/10
to spar...@googlegroups.com
Hi Mike,

What does the inside of your _Cmd file typically look like? Have you surrounded all the content in there with <content name="cmd"> cmd stuff  </content>

Not sure if I'm missing some context here, but that should work if you use the line in your application.spark file as per your email below.

Regards,
Rob



--
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.


Reply all
Reply to author
Forward
0 new messages