RenderPartial a view from another controller (and in another folder)
Posted
by George
on Stack Overflow
See other posts from Stack Overflow
or by George
Published on 2010-05-21T05:21:52Z
Indexed on
2010/05/21
5:30 UTC
Read the original article
Hit count: 756
asp.mvc
|renderpartial
Hey MVC experts.
I two database entities that i need to represent and i need to output them in a single page.
I have something like this
Views Def ViewA ViewB Test ViewC
I want to ViewC to display ViewA, which displays ViewB.
Right now i'm using something like this:
// View C
<!-- bla -->
<% Html.RenderPartial(Url.Content("../Definition/DefinitionDetails"), i); %>
// View A
<!-- bla -->
<% Html.RenderPartial(Url.Content("../Definition/DefinitionEditActions")); %>
Is there a better to do this? I find that linking with relative pathnames can burn you. Any tips?
Any chance I can make somehtiing like...
Html.RenderPartial("Definition","DefinitionDetails",i); ?
Thanks for the help
© Stack Overflow or respective owner