User Control Equivalent in ASP.NET MVC 4

You’re looking for @Html.Action and @Html.Partial.

They allow you to either render a partial view or a full blown controller action in a view. This is a common pattern of reuse in MVC land.

Occasionally you would want to make displayFor or editorFor templates, if a controller action is too heavy. The rule of thumb is if you need to do it multiple times on the page and it needs to be posted back in a form, think about doing it in a template.

Controls in asp.net cover a rather large swath which MVC granularizes a bit more.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)