I\'m trying to return value from async
html helper but it is giving following string instead of desired values.
\"System.Threading.Tasks.Tas
Views don't support asynchronous methods. So as result you get result of default .ToString()
function for type of result which indeed returns just type name.
Options:
await
. Pass data to view via model or ViewBag
.Result
, but watch out for deadlocks. See await vs Task.Wait - Deadlock? for details/links.Note: moving async
code to child action will not help.