Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Any characteristics to identify a view is partial view or not?

I know that partial view is preceded with _ sign that shows for reusable.

Any other characteristics???



Thanks in advanced

Ashish kumar verma
Posted

1 solution

There is no difference in the markup between a partial view and a view; the only difference is in how they are delivered to the browser. A partial view is sent via AJAX and must be consumed by JavaScript on the client side, while a View is a full postback. That's it.

Normally this means that a View is more of a complete web page and a partial view is reserved for individual sections or controls. Realistically, though, you can send the exact same .cshtml as a partial view or as a view.

The _ prepend is not necessarily an indicator for a partial view, in MVC.NET views it's just natively used for _Layout and _ViewStart. I personally use it to indicate sections of my master page, but that's a personal convention.
 
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