ASP.NET MVC ListBox - Header Templates

CUSTOMERS
  • Alfreds FutterkisteALFKI
  • Antonio Moreno TaqueríaANATR
  • Berglunds snabbköpANTON
  • Around the HornAROUT
  • Berglunds snabbköpBERGS
  • Blauer See DelikatessenBLAUS
  • Blondesddsl père et filsBLONP
  • Bólido Comidas preparadasBOLID
  • Bon app'BONAP
  • Bottom-Dollar MarketsBOTTM
The ListBox provides a way to customize the header of the list with items, by using the HeaderTemplate property. You can embed any content inside the header template, including HTML markup and ASP.NET MVC controls (any control from the Obout MVC Suite may be added to a header template).
View - Aspx

    <% Html.Obout(new ListBox("ListBox1")
        {
            HeaderTemplate = new OboutMvcTemplate<ListBoxHeaderTemplateContainerInfo>((info) =>
                    {%>
                        <div class="header">CUSTOMERS</div>
                    <%})          
        }); %>
    
View - Razor

    @Html.Obout(new ListBox("ListBox1")
        {
            HeaderTemplate = new OboutMvcTemplate<ListBoxHeaderTemplateContainerInfo>(
                @:<div class="header">CUSTOMERS</div>
            )
        })