Skip to content

Instantly share code, notes, and snippets.

@JoshClose
Created November 15, 2011 05:42
Show Gist options
  • Save JoshClose/1366268 to your computer and use it in GitHub Desktop.
Save JoshClose/1366268 to your computer and use it in GitHub Desktop.
Dynamically Loading Partial Views with the Spark View Engine
<use file="MyPartialView" />
<MyPartialView />
#Html.RenderPartial( myPartialViewVariable );
<ul>
<li each="var item in items">
#ViewData["item"] = item;
#Html.RenderPartial( "path/to/" + item.Name );
</li>
</ul>
<viewdata item="Item" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment