Can I use application controller for MasterPages?

Jan 7, 2009 at 7:26 PM
Edited Jan 7, 2009 at 8:16 PM

User will login to application and view/modify userpreferences. UserPreferences module is available throughout application and should be displayed as modalpopup. This module contains single page with GridView to display all user preferences and Modalpopupextender to view as a modalpopup.
I tried to put this function in master page where I am able to display as modal popup but while integrating complete module along with Controller and Service, I am facing an issue.

Expectation is,
User preferences module is available throughout application to user. Once user will view/change user preferences, control should go to respective page where user was referred earlier.
This is the reason I started thinking of putting functionality inside master page.

This module works fine by using javascript modalpopup window implementation. In this solution, problem is page_load is not called secondtime where i need to display available userpreferences.

Presenter code:
private IShellController _controller;
public DefaultMasterPagePresenter([CreateNew] IShellController controller)
this._controller = controller;

Problem is Master page is not able to understand controller and throwing exception
Exception Details: System.MemberAccessException: Cannot create an abstract class.

It seems that while initialization Master page, call is not able to instantiate controller as mentioned in above presenter code.
It seems that using  master page, i should not use WCSF application controller implementation and implement everything in Master page itself...?!!! this will void using MVP pattern and making direct dependency on Business Layer :( which is not a good practice anyway?!!

How can I achieve this? Is there any workaround

Nilesh Trivedi