+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Issue with MVC Widget on master page

Issue with MVC Widget on master page

2 posts, 1 answered
  1. Ihar
    Ihar avatar
    4 posts
    Registered:
    17 Aug 2015
    24 Sep 2015
    Link to this post

    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:
    http://www.sitefinity.com/blogs/stanislav-velikovs-blog/2012/12/15/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

    Answered
  2. Ihar
    Ihar avatar
    4 posts
    Registered:
    17 Aug 2015
    25 Sep 2015 in reply to Ihar
    Link to this post

    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 (http://www.codeproject.com/Articles/39005/Handling-Unknown-Actions-in-ASP-NET-MVC).

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

    Thanks

2 posts, 1 answered