Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3679958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:31:12+00:00 2026-05-19T03:31:12+00:00

We are trying to use the MVP pattern in our current project (asp.net app)

  • 0

We are trying to use the MVP pattern in our current project (asp.net app) and have run into some issues. The page has multiple sections and we are using user controls for these independant sections. Now each user control has its own view and presenter and the page acts as the base view. Now the question is how should the data that is needed by user control be passed to it ?

As per current design, the page presenter will get the needed data for the entire page. How can this data be passed to the user control presenter ?

Other approach we are thinking is to instead create only views for user controls and use page presenter to handle all events. In this case, we will hv multiple view interfaces to be implemented by each user control view. But how would the page presenter interact with all the different views ?

Thanks,
jbn

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:31:13+00:00Added an answer on May 19, 2026 at 3:31 am

    Why do the user controls have their own views and presenters?

    I suggest having a view and presenter for the page and interacting with the user controls via the page view. If you need to handle events or pass data to and from the user controls you can expose them to the page and the page view can wrap it for the presenter. The wrapping prevents the presenter from communicating with the user control directly.

    Here is some Pseudocode:

    IFooPageView
    {
      string SomeData {get; set;}
      event EventHandler SomeEvent;
    }
    
    public class FooPageView : IFooPageView
    {
       public event EventHandler SomeEvent;
       public SomeData 
       {
             get { return myUserControl.SomeData;}
             set { myUserControl.SomeData = value;}
       }   
    
       protected override void OnInitComplete(EventArgs e)
       {
         //handle the user control event
         this.myUserControl.SomeEvent += SomeEvent_EventHandler;
       }
    
       private void SomeEvent_EventHandler(object sender, EventArgs e)
        {            
            //Raise the user control event to the presenter
            if (SomeEvent!= null)
                SomeEvent(this, EventArgs.Empty);
        }
    }
    

    I would read Phil Haack’s ASP.NET Supervising Controller (Model View Presenter) From Schematic To Unit Tests to Code

    There is a lot of good MVP information for web forms in Phil’s article.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to use LINQ to SQL I encountered several problems. I have table
I'm trying to use svnmerge.py to merge some files. Under the hood it uses
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData .
I'm trying to use jQuery to format code blocks, specifically to add a <pre>
I'm trying to use the Optiflag package in my Ruby code and whenever I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.