shared presenter not working on the same page where is other control with default presenter

StackOverflow https://stackoverflow.com/questions/9105629

  •  21-04-2021
  •  | 
  •  

Question

I have on master page four user controls which are binded to shared presenter. Now I want to add dome other user control with default presenter and I have an exception. This problem can be seen in the default sample app available in the download package with the library. When I add the HelloWorld user control to the page SharedPresenter.aspx I got:

Expected a view of type
WebFormsMvp.IView`1[[WebFormsMvp.FeatureDemos.Logic.Views.Models.SharedPresenterViewModel,
WebFormsMvp.FeatureDemos.Logic, Version=1.4.1.0, Culture=neutral,
PublicKeyToken=null]] but ASP.controls_helloworldcontrol_ascx was
supplied. 
Was it helpful?

Solution

This question was also asked and answered in Usenet. http://groups.google.com/group/webformsmvp/browse_thread/thread/34b4fd2ea0f81de3?hl=en

Short answer: It is currently (as of 2012-02-01) not possible to use the SharedPresenter binding and a non-shared presenter simultaneously on a page. All of the views on a page will have to share one presenter instance or share none at all.

Recommendation is to avoid using SharedPresenter where possible, and use the Messaging (aka "message bus") features of WebFormsMvp instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top