How to add material styles to asp net mvc web app


ASP.NET is a popular programming language used for building web applications. One common requirement in web development is to add to an ASP.NET MVC web app. Material styles a and visually appealing user interface, making the web app more attractive and user-.

Step 1: Include Material Libraries

To add material styles to an ASP.NET MVC web app, we need to include the necessary Material Design libraries. These libraries provide pre-defined styles and components that can be easily integrated into our web app.

// Include Material Design CSS
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">

// Include Material Design JavaScript
<script src=""></script>

Step 2: Update Layout File

The next step is to update the layout file of our ASP.NET MVC web app to include the necessary HTML and CSS classes for material styles. The layout file is typically located in the Views/Shared folder and is used as a template for all pages in the web app.

// Update the layout file (Views/Shared/_Layout.cshtml)
<!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 href="~/Content/site.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <div class="container">
                <div class="nav-wrapper">
                    <a href="#" class="brand-logo">Logo</a>
                    <ul id="nav-mobile" class="right hide-on-med-and-down">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Contact</a></li>
            <p>© 2022 My ASP.NET Application</p>
    <script src=""></script>
    @RenderSection("scripts", required: false)

Step 3: Material Styles to Views

Now that we have updated the layout file, we can apply material styles to individual views in our ASP.NET MVC web app. This can be done by adding the appropriate CSS classes and HTML markup provided by the Material Design libraries.


By following these , we can easily add material styles to an ASP.NET MVC web app. The Material Design libraries provide a wide of pre-defined styles and components that can be used to enhance the user interface of our web app. With material styles, our web app will have a modern and visually appealing look, improving the overall user experience.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents