I still don't get the primary purpose of Html.Action
in asp.net mvc. I have been using Html.Partial
every time I need to load up a partial view or wanted to split up some code in a view to clean it up.
Where does Html.Action
fit into all of this (e.g. where would you want to use Html.Action
and not use Html.Partial
)?
Edit
The answers seem to be use Html.Action for dynamic data. I don't get this as you can use Partial Views for Dynamic data as well.
For instance if a user on my site edits a row. A ajax call is made to a method and I go grab that row from the db. I then return a parital view of a form that has all the data on it ready for editing. If an error occurs then I return a json result with the error method and my javascript consumes it and alerts the user.
If all is good then the rendered html is put into a jquery dialog and displayed to the user.
Is it because you can use the "ChildActionOnlyAttribute" that makes people use Action instead?