Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVP Pattern
    text
    copied!<p>I'm trying to implement the Model-View-Presenter design pattern in my application. The general concept of the MVP pattern is known for me, but I'm more struggling with getting it done using nested usercontrols.</p> <p>I've got a few possible scenarios I might be able to implement, but before doing so I'd like to hear your opinion.</p> <p>I think it does not matter to post any of my code, since its more a "concept" I'm trying to understand.</p> <p>So the scenario is:</p> <p>1 page used to connect 2 user controls. One of these usercontrols contains a child usercontrol. How do I work around with MVP pattern in this case?</p> <pre><code>1 Page 1 UC 1 UC 1 SubUC </code></pre> <p>Edit:</p> <p>So basicly what I want to know is how we can interact between two views (parent and child) using MVP in both usercontrols.</p> <p>I'll show you an example in ASP.net WITHOUT MVP: <a href="http://pastie.org/5452134" rel="nofollow">http://pastie.org/5452134</a></p> <p>Now with MVP, do we still register to this kind of event using the CodeBehind? Knowing that this parent and child usercontrol would both be using the MVP pattern. Or does the presenter get's included in this interaction?</p> <p>Eventually I can change the code to: <a href="http://pastie.org/5452180" rel="nofollow">http://pastie.org/5452180</a></p> <p>But I'm wondering whether this is OK, considering the MVP pattern...</p> <p>Or do we more need an approach like this: <a href="http://pastie.org/5452174" rel="nofollow">http://pastie.org/5452174</a></p> <p>All the above examples are written in the CodeBehind of the parent view. Is one of this correct? If not, how can we achieve this using a better approach</p> <p>Edit 2: I've added a solution with my example approach at: <a href="https://github.com/frederikprijck/ASP.NET-MVP" rel="nofollow">https://github.com/frederikprijck/ASP.NET-MVP</a> I think this should be pretty much what I wanted... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload