Async Partial View in Form

1 Answer 93 Views
Form TabStrip
Chris
Top achievements
Rank 1
Iron
Iron
Iron
Chris asked on 28 Nov 2024, 12:16 PM

I have used partial views in many places, usually nested within a tab control, but also in some places nested inside a for EditorTemplate.

This was done using following type of code :

Html.Partial("_PartialViewName", Model)

Visual Studio was warning of :

MVC1000 : Use of IHtmlHelper.Partial may result in application deadlocks. Consider using <partial> Tag Helper or IHtmlHelper.PartialAsync.

So I went through and changed code where I could to :

awaits Html.PartialAsync("_PartialViewName", Model)

This works fine where the partial was within a tab control, or direct on the view but not when it's within an EditorTemplate on a form. Trying the same code gives this error :

The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.

I have tried a few things but nothing that VS will accept. Can it be done?

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 03 Dec 2024, 12:10 PM

Hi Chris,

Thank you for your report.

I have logged it as a bug on your behalf in our Public Feedback Portal:

https://feedback.telerik.com/aspnet-core-ui/1672300-editortemplateview-option-does-not-accept-partialasync-method

We sincerely thank you for finding the bug.  As a token of gratitude, I have updated your Telerik account points.  

If you have any questions, don't hesitate to contact me back.

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.

Tags
Form TabStrip
Asked by
Chris
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Mihaela
Telerik team
Share this question
or