I hope this will be an easy answer but I can't seem to find it searching.
I have an aspx page with a partial view inside of it.
I am inserting the partial view with the syntax like this: <TagPrefix:TagName ID="PartialView1" runat="server"/>
I get "Object not set to reference errors though, unless I click a link to the data with my controller like this:
The partial view has a controller that loads data like this:
public ActionResult MyPartialViewWithData()
{
return PartialView("Data/Home/Home", _entities.MyDataSet.ToList());
}
Is there a way to insert the PartialView with a reference to the model? I found html.RenderPartial and some others but had trouble getting it to work.
Thanks in advance!