Sidebar with partial view

17 Feb 20226 minutes to read

The following example demonstrates how to render the sidebar with partial view. Sidebar element is placed inside the RenderPartialView.cshtml and refer that sidebar element in layout page.

<!DOCTYPE html>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>@ViewBag.Title - My ASP.NET Application</title>
        <link rel="stylesheet" href="">
        <link rel="stylesheet" href="" />
        <script src=""></script>
        <div id="body_content" class="maincontent">
            <div style="padding: 1.5vw 3vw;">
        @RenderSection("scripts", required: false)
@using Syncfusion.EJ2

<table class="table">
    <div id="top-bar">
        <div class="component">
            <span class="header">Components</span>
            <span><i class="fa fa-angle-right" style="font-size:16px"></i></span>
            <span class="header">Inputs</span>
            <span><i class="fa fa-angle-right" style="font-size:16px"></i></span>
            <span class="header">TextBox</span>
    <div id="feature">
        <div class="content">
            <div class="body-inner">
            <div style="text-align:left">
                <div style="font-size:2vw">Overview</div>
                <div class="text">The ASP.NET MVC TextBox (text field) control is most useful for editing, displaying, or entering plain text on forms to capture user names, phone numbers, email, and more. This control is an extended version of the HTML5 TextBox (input type text) control with icons, floating labels, different sizing, grouping, validation states, and more. It is available in an HTML5/CSS version and an ASP.NET MVC version.</div>
            <div style="padding:2vw 0 2vw 0;text-align:left">
                <div style="font-size:1.5vw">Key Features</div>
                <div class="text">
                    <p>1. <b>Floating Label  : </b>Floats the placeholder text while focus.</p>
                    <p>2. <b>Input Group : </b>Group the icons, buttons along with textbox.</p>
                    <p>3. <b>Validation States: </b>Provides styles for success, error, and warning states.</p>
                    <p>4. <b>Multiline : </b>Handles multiline input with placeholder text.</p>
            <div class="link">
                    <span style="float:left"><a href="">Documentation Link</a></span>
                    <span style="float:right"><a href="">Samples Link</a></span>

Output be like the below in layout page.

Sidebar Sample