MVC Widget on master page disapears when other view is displ

Posted by Community Admin on 04-Aug-2018 15:53

MVC Widget on master page disapears when other view is displayed

All Replies

Posted by Community Admin on 03-Jul-2013 00:00

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 right for a login control.  I then created a custom login control using MVC 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 MVC widget to the body of the page which links to another view the login widget placed on the master template disappears when the view is changed for example /reports to /reports/detail/1.

For example:

  1. Create a master page .
  2. On the master add 2 place holders (one for a custom MVC login widget, and another for body content).
  3. Add the master in Sitefinity as a page template.
  4. Edit the page template in sitefinity  for the master and add an MVC widget to the login placeholder so all pages created from the template will display it by default.
  5. Create a new page using that template and add another widget the body placeholder that has links to another view, for example edit links.
  6. When you navigate to the page everything appears fine, but if you click edit the login widget disappears.

I assume this has something to do with the fact that when the body MVC widget changes to an edit or detail view, the login widget must also have a view with the same route.  Since it doesn't it does not display.  Is there a way to make sure that other widgets on the same page play well together when changing views.

Posted by Community Admin on 07-Jul-2013 00:00

I have come across the same problem.
This is how to reproduce problem: (basically same as above)

  1. Place an MVC widget on page template
  2. Create a page and place a master/detail MVC widget on the page
  3. Navigate to page and everything works
  4. Click link that points to detail and when page loads all the MVC widgets from page template disappear
Everything works fine if  you only use the Index() actions for all MVC widgets. As soon as you use another action the other index actions are not hit.

Is there something we can do to get this to work?
I do remember in on the the MVC webinars there was mention of ensuring we use different action names as there may be problems. Not sure if this issues is related though.

Posted by Community Admin on 08-Jul-2013 00:00

Hello,

I would suggest you to review the following blog post where you will find useful information:

www.sitefinity.com/.../how-to-display-mvc-widget-in-detail-views-of-content-items

Regards,
Stefani Tacheva
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed