An outlet for my obsession with technology
Html.RenderUserControl and ASP.NET MVC Preview 5
Html.RenderUserControl has been superceded by Html.RenderPartial
1: <% Html.RenderPartial("~/Views/Shared/MyControl.ascx") %>
2: <% Html.RenderPartial("MyControl") %>
You can specify the full path to your user control as in the first example. Or, if your user control is in the ~/Views/Shared folder, you can use the second example.
Notice that Html.RenderPartial does not produce a return..aka…the = is removed.
No related posts.
| Print article | This entry was posted by Eric Polerecky on September 2, 2008 at 1:16 pm, and is filed under ASP.NET MVC. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 1 year ago
thank you very much, i’ve been lost for past half of hour trying to figure out where’s renderUserControl method (seems i’m lerning by an ould tutorial
)…