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.

asp.net forums

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

  2 Responses to “Html.RenderUserControl and ASP.NET MVC Preview 5”

  1. [...] to VoteHtml.RenderUserControl and ASP.NET MVC Preview 5 (9/2/2008)Tuesday, September 02, 2008 from Eric Polerecky… to your user control as in the first example. Or, [...]

  2. 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 :D )…

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 eric.polerecky.com Suffusion theme by Sayontan Sinha