What is the point of Partial Views in Asp.net MVC

后端 未结 8 1936
北恋
北恋 2020-12-30 00:49

Ive noticed that there seems to be no real difference between a view and a partial view. For instance, one can create a view but can render it as a

8条回答
  •  执笔经年
    2020-12-30 01:36

    Quite late but might be useful for someone with the same question. Partial views are helpful in a scenario where you want to load a view based on some user selection.

    For instance, let's assume there is a dropdown in parent view displaying three operations that the user can perform. Based on the user selection, a partial view can be loaded into the parent view instead of keeping hidden DIVs in the parent view itself, thus making the parent view light. This will be very useful when we have multiple such user selections based DIVs

提交回复
热议问题