presenter object is null in page load of user control

Topics: General Discussion Forum
Mar 11, 2009 at 4:20 AM
Hi,

   I tried using default.aspx to display data on a grid and data.aspx for data entry/modifications, they have respective Presenters, now in this project, the requirement is to put the data.aspx in a user control, and put this user control in a default.aspx...Problem encountered so far is at Page load...this._presenter is null...How can I initialized this presenter object???

Developer
Mar 11, 2009 at 8:36 AM
Hi,

Can you give some further context of the problem? Which is the sample/project where you have this issue?
Thanks,
Hernan
Mar 12, 2009 at 1:43 AM
Edited Mar 12, 2009 at 1:45 AM
Hi hernandelahitte,

   I have a module say configurations which normally has a default.aspx displaying data in a gridview, has add button, edit function when you click a row, a presenter (DefaultViewPresenter.cs), and a Data.aspx which is for data-entry/modification for each record of configurations, with its own presenter (DataPresenter.cs). Now, the requirement, is to put Data.aspx in a usercontrol, and put this user control in Default.aspx, toggle between gridview section and this user control section, tried retaining both presenter, but the presenter object in user control is always null...I tried combining two presenter into one and seems working....looking for way to retain 2 presenters and lityle change of codes from Data.aspx to the user control???? Thanks

Dennis
Mar 12, 2009 at 3:49 AM
Edited Mar 12, 2009 at 4:00 AM
I have found an approach that uses both Presenters...

My approach is to inherit both presenters in default.aspx.cs and inherit only DataPresenter.cs in usercontrol...When a button event that shows Data.aspx, I supplied the instance object of DataPresenter to usercontrol...

Is there other approach I like to know??? 

Developer
Mar 12, 2009 at 9:08 AM
As far as I know, I guess you may find a better answer in the Web Client Software Factory sites here:
http://websf.codeplex.com/
http://wcsfcontrib.codeplex.com/

Thanks,
Hernan