I really don't understand the usage of Html.Action(string,object)
its return type is HTMl string so why do we even need it? and whats its relation with partialviewresult ? I have seen some people using @html.action(String actionname,Object routeobject);
in any of their view and controller invoked by this method returns a partialviewresult whats that ?

- 43
- 1
- 4
-
1Please note that the model-view-controller tag is for questions about the pattern. There is a specific tag for the ASP.NET-MVC implementation. – Jul 02 '16 at 23:33
-
I understand that thanks for notifying anyway! – WaqarUlKhaf Jul 03 '16 at 12:14
1 Answers
Firstly, HtmlString represents an HTML-encoded string that should not be encoded again. HtmlString Class
There is a answer that I believe is good from this question:
@Html.Action
and @Html.RenderAction
are used when your partial view model are independent from parent model, basically it is used when you want to display any widget type content on page. You must create an action method which returns a partial view result while calling the method from view.
More, use Html.Action when you actually need to retrieve additional data from the server to populate the partial view
Please have a look at the documentation for more detailed information.
More questions about the same topic:
MVC Html.Partial or Html.Action
Maybe a bit of research before posting a question would be better

- 1
- 1

- 615
- 1
- 7
- 13