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 in MVC example.


Partial view is a special reusable view. It’s like as a user control in web form application.

Partial view can use multiple in other view. It reduces duplicate coding by reusing same partial view in multiple places.

let's create a simple partial view.

Partial View in Mvc



<h1>This is my Partial View.</h1>
<table style="width:50%">
table, th, td {
   border: 1px solid black;


Use Partial View in Index.cshtml


    ViewBag.Title = "Index";
<h1> using Partial</h1>
<h1> using RenderPartial</h1>

when you run above code output will be show like below.


Partial View in Mvc

  • Html.Partial():

@Html.Partial() helper method renders the partial view as HTML-encoded string. It takes partial view name as a string parameter and returns Html String.

  • Html.RenderPartial():

The RenderPartial helper method is similar to the Partial method except that it returns void and writes resulted html of a given partial view into an http response stream during execution.

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