locked
Await method not working. RRS feed

  • Question

  • User1421620300 posted

    Is their a fix to the following error? The only error within solution, neem working back and forth to get application to run! So after clearing all errors application still doesn't run. So now trying to work backwards. Markus


    @{await Html.RenderPartialAsync("_Navigation");}
    <div id="page-wrapper">
    <div class="container-fluid">

    Severity Code Description Project File Line Suppression State
    Error CS4033 The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. Sports_ C:\Users\Andrew\Documents\Visual Studio 2015\My Projects\Sports_ - Copy - Copy\Sports_\Views\Player\Create.cshtml 45 Active

    Wednesday, November 14, 2018 9:01 PM

Answers

  • User1520731567 posted

    Hi Markus33,

    @{await Html.RenderPartialAsync("_Navigation");}

    Await Html.RenderPartialAsync seems to be commonly used in Core

    In MVC,I suggest you could use:

    @{Html.RenderPartial("_Navigation");}

    Best Regards.

    Yuki Tao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 15, 2018 2:53 AM