Razor partial view – Html.RenderPartial – Cannot implicitly convert type ‘void’ to ‘object‘

Razor Html.RenderPartial “Cannot implicitly convert type ‘void’ to ‘object’.”
When I tried to render my partial view with a standard call I got a compile time error saying “Cannot implicitly convert type ‘void’ to ‘object’.”

The reason behind this compile time error was the RenderPartial() call renders its result directly to the response object and cannot be used like a simple string result.

To resolve the issue, all you have to do is enclose the call in a code block.

{Html.RenderPartial