Issue with MVC Widget on master page - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Issue with MVC Widget on master page

  • Issue with MVC Widget on master page
  • Hello all, 

    I am using MVC to create widgets, but have a confusing situation going on.

    I created a custom masterpage with a placeholder in the top for custom widget.  I then created a custom widget using MVC (VS 2013) which is placed on the master page template within the sitefinity backend designer.

    This all works as expected when creating pages using the master page template, but if I add an master/detail  (or master/detail  MVC or custom master/detail  MVC) widget to the body of the page and click link that points to detail, widget placed on the master template disappears when the view is changed.

    This is how to reproduce problem:
    1. Place an custom MVC widget on masterpage
    2. Create a page and place a master/detail widget on the page
    3. Navigate to page and everything works
    4. Click link that points to detail and when page loads all the custom MVC widgets from page template disappear

    I reviewed the following blog post:
    www.sitefinity.com/.../how-to-display-mvc-widget-in-detail-views-of-content-items

    but it is not the same situation. I have custom MVC widget on the template. 

    Thanks

  • Answer from Telerik team:

    The issue in this case is that when you're viewing the list widget on the page, an URL parameter is added to the URL and this is how it knows which content item to display in the "Detail view" mode. However I presume your custom MVC widget isn't configured to handle "unknown actions" (like to disregard them, etc), so it tries to handle them which is why it disappears (www.codeproject.com/.../Handling-Unknown-Actions-in-ASP-NET-MVC).

    Try adding a HandleUnknownAction handler. I believe this should do it.

    Thanks