why does this error occur.. The best overloaded method match for ‘System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)’ has some invalid arguments…when I am trying to put a partial view in a div like
<div>@Html.RenderPartial("_pagePartial");</div>
thanks for your help.
Because the correct syntax is this (notice the
{ }s):or if you prefer:
The reason for this is that contrary to the
Partialextension methodRenderPartialdoesn’t return anything. It directly writes to the output stream. Contrast this with the WebForm equivalents: