### Bug report
When loading an editor through a partial View using EditorTemplateView(await Html.PartialAsync("PartialViewName")), the following error occurs:
The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.
### Reproduction of the problem
@(Html.Kendo().Form<UserViewModel>()
.Name("myForm")
.Items(items =>
{
items.Add().Field(f => f.Username).EditorTemplateView(await Html.PartialAsync("PartialViewName"));
})
)
### Expected/desired behavior
The EditorTemplateView() must accept Html.PartialAsync("PartialViewName").
### Environment
* **Telerik UI for ASP.NET Core version: 2024.4.1112
* **Browser: [all]
Closing this after further discussion. Such functionality would inevitably require introducing an asynchronous piece of logic within a synchronous method. This poses a risk in terms of how the underlying threading mechanism for the framework handles this situation.
Adding such a feature would inevitably place the UI thread in a predicament, as it may produce:
There are several topics that discuss this in a more comprehensive manner:
It is possible to use a code block, await the call to Html.PartialAsync and pass the result to the EditorTemplateView:
@{
var myTemplate = await Html.PartialAsync("PartialViewName");
}
@(Html.Kendo().Form<UserViewModel>()
.Name("myForm")
.Items(items =>
{
items.Add().Field(f => f.Username).EditorTemplateView(myTemplate);
})
)
Regards,
Mihaela
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.