Mvc 3 Razor : Using Sections for Partial View? <p>I defined a section in partial view and I want to specify the content of section from view. But I can't figure out a way. In asp.net user controls, we can define asp:placeholders, and specify the content from aspx where user control lies. I'll be glad for any suggestion.</p> <p>Thanks</p> <p>[edit] Here is the asp.net user control and I want to convert it to razor partial view</p> <p>User control:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="SpryListView.ascx.cs" Inherits="SpryListView" %&gt; &lt;div spry:region="&lt;%=this.SpryDataSetName%&gt;" id="region&lt;%=this.ID%&gt;" style="overflow:auto;&lt;%=this.DivStyle%&gt;" &gt; &lt;table class="searchList" cellspacing="0" style="text-align:left" width="100%"&gt; &lt;thead&gt; &lt;tr&gt; &lt;asp:PlaceHolder ID="HeaderColumns" runat="server"&gt;&lt;/asp:PlaceHolder&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;/table&gt; </code></pre> <p>User control code:</p> <pre><code>public partial class SpryListView : System.Web.UI.UserControl { private string spryDataSetName ; private string noDataMessage = "Aradığınız kriterlere uygun kayıt bulunamadı."; private bool callCreatePaging; private string divStyle; private ITemplate headers = null; private ITemplate body = null; [TemplateContainer(typeof(GenericContainer))] [PersistenceMode(PersistenceMode.InnerProperty)] public ITemplate HeaderTemplate { get { return headers; } set { headers = value; } } [TemplateContainer(typeof(GenericContainer))] [PersistenceMode(PersistenceMode.InnerProperty)] public ITemplate BodyTemplate { get { return body; } set { body = value; } } public string DivStyle { get { return divStyle; } set { divStyle= value; } } public string NoDataMessage { get { return noDataMessage; } set { noDataMessage = value; } } public string SpryDataSetName { get { return spryDataSetName; } set { spryDataSetName = value; } } public bool CallCreatePaging { get { return callCreatePaging; } set { callCreatePaging = value; } } void Page_Init() { if (headers != null) { GenericContainer container = new GenericContainer(); headers.InstantiateIn(container); HeaderColumns.Controls.Add(container); GenericContainer container2 = new GenericContainer(); body.InstantiateIn(container2); BodyColumns.Controls.Add(container2); } } public class GenericContainer : Control, INamingContainer { internal GenericContainer() { } } protected void Page_Load(object sender, EventArgs e) { } } </code></pre> <p>aspx</p> <pre><code>&lt;spry:listview SpryDataSetName="dsOrders" CallCreatePaging="true" runat="server" ID="orderListView"&gt; &lt;HeaderTemplate&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;th&gt;SİPARİŞ TARİHİ&lt;/th&gt; &lt;th style="text-align:right"&gt;GENEL TOPLAM&lt;/th&gt; &lt;th style="text-align:right"&gt;KDV&lt;/th&gt; &lt;th style="text-align:right"&gt;NET TOPLAM&lt;/th&gt; &lt;/HeaderTemplate&gt; &lt;/spry:listview&gt; </code></pre> <p>[edit]</p> <p>I want to do exactly this in mvc 3 razor partial view.</p>