What is difference between partial view and strongly view
What is the difference between partial view and strongly view.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nilesh JadavRank #109 · 20.3K reputationPosted Aug 25, 2016, 11:20 PM EDT
This answer might help you :
A partial view is nothing more than a "piece" of Html that you can keep in a separate file that you can reuse in other views. Sort of like UserControls in ASP.NET WebForms.
A Strongly Typed view means it has a ViewModel associated to it that the controller is passing to it and all the elements in that View can use those ViewModel properties
You can have strongly typed partials as well. Meaning that piece of Html needs specific data so you type it to a certain ViewModel
Here is an example of a Strongly Typed View
A view that is not strongly typed does not have a
@model SomeViewModellineHere's an example of a controller action that renders a normal view without a ViewModel
Here's one that renders a strongly typed View
And the view makes use of that ViewModel by having the
@model SomeViewModelat the top of the file.So now that the view has a ViewModel I can display elements that are bound to the ViewModel like
So any data entered into those fields are bound to the ViewModel. When the user clicks the submit button, those entered values get sent back to the server.
As I said before, partial view is a reusable piece of Html. So in that same view I can add in my partial. Let's say I have a partial view that contains a standard bit of Html that I want to reuse all over my site, like a Footer
I can create a .cshtml file and put this inside it
And then include it on any View, doesn't matter if it's strongly typed or not, it's just reusable Html
Hope that might helps you !