Thanks Denis. That makes more sense. Like I said, I am posting so there is at least something for the next person to find. There are numerous tutorials online that have the RenderPage method within a braces block!!!
it's normal @{ renderpage } is not working tough you should have used @(renderpage) for this or @{ viewbag.listcreate = renderpage().tohtmlstring(); } and use viewbag.listcreate where you want the page to be
alexbss
0 Points
2 Posts
RenderPage Bug with Solution
May 08, 2012 10:06 AM|LINK
I wanted to put this up for anyone who has been smashing their head against the wall like I have.
RenderPage only seems to work if on a line of its own, without braces
This Line DOES NOT work.
@{
RenderPage("../Shared/Elements/ListWithCreate.cshtml", Model.LeftListItems);
}
But this DOES work.
@RenderPage("../Shared/Elements/ListWithCreate.cshtml", Model.LeftListItems)
DenisM
Member
124 Points
45 Posts
Re: RenderPage Bug with Solution
May 08, 2012 11:33 AM|LINK
What about
@{ Html.ActionLink(...); } @{ Html.Partial(...); }another bug?
You just discovered specialty of razor syntax and usage of @ with methods, which return result or render result directly.
In this case @RenderPage works, because it returns value.
alexbss
0 Points
2 Posts
Re: RenderPage Bug with Solution
May 08, 2012 01:05 PM|LINK
sp00k
Participant
1916 Points
435 Posts
Re: RenderPage Bug with Solution
May 29, 2012 06:34 AM|LINK
it's normal @{ renderpage } is not working tough you should have used @(renderpage) for this or @{ viewbag.listcreate = renderpage().tohtmlstring(); } and use viewbag.listcreate where you want the page to be