Here we will explain how to use Partial view in MVC or what is Partial view in MVC or how to reduce duplicate coding using Partial view or how to render partial view with passing parameter in MVC example.

Description: MVC Html.Partial() helper method renders the partial view as HTML-encoded string. It takes two parameter and returns Html is use to displaying data in the partial view is independent from corresponding view model. For example:  In a blog to show tag or category list on each and every page, we would like to use Html.Partial() method since the list of category is populated by the different model.

Let’s see a demonstration example of Html.Partial() helper method 

In this example we are passing model as parameter.


@model List<Tutorials.Product>
        Layout = null;
  <meta name="viewport" content="width=device-width" />
  <title>Reder Partial View</title>
<link href=""rel="stylesheet" />
        <div id="ProductList">
         @Html.Partial("ProductList", Model)


@model List<Tutorials.Product>
<div class="table-responsive" style="width:500px;">
    <table class="table">
                <th>Product Name</th>
                <th>Model No</th>
            @foreach(var item in Model)


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Tutorials.Controllers
    public class HomeController : Controller
    {                public ActionResult Index()
            ArticleEntities db = new ArticleEntities();
            return View(db.Product.ToList());




 how to render partial view with model parameter in mvc

I hope it will help to you.


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like