Render Partial View in MVC 4

Partial view are reusable feature of MVC 4, when we need to minimize the code complex on your view that time we decompose more than one view and call partially on your master view.

                                                             OR

We can say that when we need to make a common view and want to display in the different common area in the parent view that time 'common view' called a partial view.

For Example:

In a demo product application, we have needed to display to common product information in across page view that time, we create a partial view ‘CommonProducts.cshtml’ for display to common products in across application in the suitable area.

             <div>
                 <!—Common products are -->
                      @{Html.RenderPartial("CommonProducts");}
                 <!--End -->
             </div>

In above, we render to partial view to display common products in the common area. In MVC 4, we can render a partial view using the syntax:

@{Html.RenderPartial("CommonProducts");}

Here, name of view want to render to partially be “CommonProducts”.



ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
http://www.code-sample.com
http://www.code-sample.xyz

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.