November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
The modelbinder API uses names of parameters to decide if a certain model binder should handle the parameter, EPiServer will bind content parameters named "currentPage", "currentContent" and "currentBlock". So in your case name the parameter in Index method to any of those and the model binder will bind data to the parameter.
Hi everyone
We just started to work on a brand new epi7 site and it's a whole lot of fun.
But every page that we're making just returns null in the ActionResult index parameter. All except the startpage, which leads me to think that something's wrong with the routing. But that's just a guess.
This is how one of our controllers look like
public class ArticlePageController : BaseController<ArticlePage>
{
private IContentRepository _contentRepository;
public ArticlePageController(IContentRepository contentRepository)
{
_contentRepository = contentRepository;
}
public ArticlePageController()
{
}
public ActionResult Index(ArticlePage articlePage)
{
var model = new ArticlePageModel
{
Heading = articlePage.Heading,
MainBody = articlePage.MainBody
};
return View(model);
}
}
We have a View aswell and there's no typos nor anything.
But everytime we run a page we get "articlePage is null", or whatever page we try to run. All except startpage.
I'm sure the solution is dead simple but I'm all out of ideas :) Thanx in advance