MVP on Asp.Net WebForms
        Posted  
        
            by Nicolas Irisarri
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Nicolas Irisarri
        
        
        
        Published on 2009-03-19T23:27:33Z
        Indexed on 
            2010/03/13
            12:45 UTC
        
        
        Read the original article
        Hit count: 727
        
I'm not clear about this....
When having a gridview on the View, is the controller who has to set up the Data source, columns, etc? or I just have to expose the DataBinding stuff, fire it from the controller and let the html/codebehind on the view handle all the rendering and wiring up?
To be more precise: on the view should I have
private GridView _gv
public _IList<Poco> Source { 
    get {_gv.DataSource;}
    set {_gv.DataSource = value;
         _gv.DataBind();}
}
Or should it be (from http://stackoverflow.com/questions/153222/mvp-pattern-passive-view-and-exposing-complex-types-through-iview-asp-net-web)
private GridView _datasource;
public DataSource 
{
  get { return _datasource; }
  set 
  { 
    _datasource = value; 
    _datasource.DataBind(); 
  }
}
Maybe I'm having it all wrong ....
Where can I find an example that is not a "Hello world" example on MVP for ASP.Net???
© Stack Overflow or respective owner