Partial View in Asp.Net MVC

How to use Partial View in Asp.Net MVC .

1> Create a Partial View for Index Action.

   Right Click on Home Folder-> Add->Click View.





























2>Name the Partial view name as _HomePartial-->Choose the Create as a partial view.
   and click the button to Add.



3> Now write the Content on _Homepartial to Display in Index Action.













 









4>Now Open the HomeController , here you will Find Index Action as Default.
now Right Click on Index Action .




















5> Create View for an Index Action







6> Now Call the Partial View in the Index View using syntax @Html.Partial("")
   @Html.Partial("~/Views/Home/_HomePartilal.cshtml")



7> Now Run the Programm.

Share this

Previous
Next Post »