Sometimes we would like to call controller action method from View without the method completely tied to view. What I mean is direct browser access such as http://localhost/Home/GetCustomer/2
Now we have scenario where we want such action method to rendered partial view using html.action() that in turns calls Action method in controller. For such cases we have [ChildOnlyAction]attribute.
View-> html.action -> Calls Action Controller -> loads partial view
[ChildOnlyAction]
public ActionResult CanOnlyBeCalledInternalByView()
{
return PartialView();
}
Now we have scenario where we want such action method to rendered partial view using html.action() that in turns calls Action method in controller. For such cases we have [ChildOnlyAction]attribute.
View-> html.action -> Calls Action Controller -> loads partial view
[ChildOnlyAction]
public ActionResult CanOnlyBeCalledInternalByView()
{
return PartialView();
}
No comments :
Post a Comment