So I've been trying to figure out a way to use a Model called Posts in my layout for a few days now, and a solution (that would be perfect if it worked for me) was:
@Html.RenderAction()
Which gave me an error of:
'IHtmlHelper>' does not contain a definition for 'RenderAction' and no extension method 'RenderAction' accepting a first argument of type 'IHtmlHelper>' could be found (are you missing a using directive or an assembly reference?)
I've tried fixing it the error by adding the following to the web.config file, but it doesn't change a thing,
<system.web>
<pages>
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Html"/>
</namespaces>
</pages>
</system.web>
trying using System.Web
doesn't do anything because the namespace "Web" doesn't exist in "System".
Is there anything I can change to use the Html.RenderAction() method?