I’ve come to an MVC3 project I wrote just a week ago which has stopped working and is throwing the following error:
Error 10‘
The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(System.Web.Mvc.HtmlHelper, string)' and 'System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(System.Web.Mvc.HtmlHelper, string)
What is the reason for this? I haven’t changed anything in project recently for it to bork. The code I call it in looks like this:
<div class="page-body">
@if(!String.IsNullOrWhiteSpace(ViewBag.ErrorMessage)) {
// Output error message
Html.Raw(ViewBag.ErrorMessage);
} else {
// Render upload form
Html.RenderPartial("_UploadForm");
}
</div>
You are missing @ symbols front of your Html.Raw because teh method reutrns a string back hence requires the @symbol
Please use it this way