What is ChildActionOnly?
The ChildActionOnly attribute ensures that an action method can be called only as a child method from within a view.
Where to use ChildActionOnly?
- ChildActionOnly it related with partial views but it is not compulsory.If decided to not access through url then we may declare as ChildActionOnly
- This attribute used to prevent the action methods,being invoked as a result of a user request ,that is it prevent from accessing via url
public ActionResult GetUserDetails(int userId)
//Your Logic Here !!!
return PartialView(“GetUserDetails”, null);
calling this by