See this post for reference: http://world.episerver.com/Archive/EPiServer-Next-Version/Forum/Developer-TAP-Forum/Thread-Container/2013/3/Routing-with-MVC-for-product-display/
David, that post is from the old TAP forums, which is not open to everyone :-)
Sandeep: For Episerver controllers, the model binder will check and see if the name of the parameter is currentPage/currentBlock/currentContent. If it is, it will get the current content from the routeData. So, as Dejan says, changing the parameter name to currentBlock should do the trick
Good point Per, the post was from 2013 so thought we might have opened them by now ;)
Maybe add a warning in log if a controller method (that inherits from Episervers base controllers) contains a parameter that inherits from IContent but isn't named correctly?
hi here i have a block with 2 views, i want to display view depend on situation.
so i just folled this article.block with partial view
so here my block is inherited from siteblockdata.
here is my code.
public override ActionResult Index(BlockData blockData)
{
var viewName = string.Empty;
JobSearch js = new JobSearch();
if (blockData == js)
{
viewName = "promo";
}
//return PartialView(string.Format("{0}{1}.cshtml", PARTIAL_VIEW_DIRECTORY, viewName));
return null;
}
am getting block data is null.