I am receiving a
"Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'"
error message using the code below. I have tried suggestions in several other questions posted here and none have worked. Can anyone spot what I'm doing wrong and give me straightforward, novice-level instructions to fix it?
Partial view HomeContent:
@model JobBoard.Models.HomeContentModel
<div id="about-text">
@Model.HomeContent
</div>
Controller:
[ChildActionOnly]
public ActionResult HomeContent(int CompanyId)
{
string cid = Convert.ToString(CompanyId);
HomeContentModel content = new HomeContentModel();
content.HomeContent = (from c in db.Companies
where c.TW_CompanyID == cid
select c.JBContent).First();
return PartialView(content);
}
View:
@{Html.RenderAction("HomeContent");}
(I have also tried Action, Partial and RenderPartial. The partials work, but of course do not trigger the ActionResult, which I need).