I want use ajax to prevent refresh my pages and for this I want return Views by PartialView method from controller on ajax call.
The questions is:
- Is it good way to return a
View
asPartialView
? - How should I set path of views in
PartialView
method inController
?
For example for _Index view in Views/BasicInfo/_Index path, I try
PartialView("~/Views/BasicInfo/_Index");
,
PartialView("~/Views/BasicInfo/_Index.chtml");
, PartialView("BasicInfo/_Index");
, and get error as not found the view
EDIT
How specified view name into PartialView method, if view is in a folder out of the Shared folder and out of related view folder. For example My controller is name is controller1 and my View is in this path Views/BasicInfo/_Index ?