Click here to Skip to main content
15,885,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Difference between Partial View and Layout View ?

and tell how can partial view be used to avoid rendering other view in the parent view ?
Posted

Partial View is used to display repeated summering information (like user control in ASP.NET Web Form)

Layout View is designed for the application that has different section for each block and to display same layout to entire web application (Like Master Page in ASP.Net Web Form)

Partial view just render itself without calling his paranet.

you can call partial view by jQuery/Javascript means partial view can be calling use Ajax or Ajah.

Suppose you are developing an ASP.NET web application and you want to maintain a consistent look and feel across all the pages within you web application. You then have two options, the first one is to design the head, body and footer sections on each page. In this approach you need to write more code on each page so ASP.NET 2.0 introduced "Master Pages" that helps enable this when using .aspx based pages or templates. It is your second option. Razor also supports this concept with a feature called "layouts" that allow you to define a common site template, and then inherit its look and feel across all the views/pages on your web application.
 
Share this answer
 
Comments
Karthik_Mahalingam 15-Jan-14 7:47am    
5!
Sandeep Singh Shekhawat 15-Jan-14 7:54am    
Thanks dear Karthik Sir..
Karthik_Mahalingam 15-Jan-14 8:04am    
welcome Sandeep :)
On top of Sandeep solution. to know more
Please read this excellent document ASP.NET MVC Special Views - Partial View and Layout[^]
note: download the zip file and Read the PDF
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900