To call the PartialView in ASP.NET MVC, two methods can be used
@Html.Partial("PartialViewName") and
@Html.RenderPartial("PartialViewName")
However, calling @Html.RenderPartial method throws below exception.
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments This exception comes because @Html.RenderPartial returns void as it writes the content of the Partial view in Response stream.
To fix this issue, we need to call the @Html.RenderPartial in the code block under {} in Razor like below.
@{ Html.RenderPartial("_GetFileName"); } Hope it helps.
Regards,
Sheo Narayan
http://www.dotnetfunda.com