G
Guest
I want to create a WebForm that acts as a "template" for some of my other
forms. For instance a "List Template" that includes a GridView and buttons to
Refresh, Display, Add, Modify and Delete record, all located in the correct
place with the correct visual characteristics and the correct event handlers
already wired up and with the appropriate code already in place to
(consistantly) test for things like "you can't display that record because
someone else has deleted it".
As a Windows Application I would do this by creating a base class that
includes these characteristics and then I would inherit from it to create my
concrete forms. The base class would include some MustOverride methods that
would delegate to the derived classes to retrieve things like the required
dataset and the business rule object required to fill and update it.
I'd like to do something similar in asp. I've played around with MasterForms
and these appear to provide everything necessary from a visual perspective.
However, I can't find a way to implement event handlers in the MasterForm
that can call methods in the ContentForm. I think I will need to do this so
that when, for instance, the Refresh button is clicked, the MasterForm can
retrieve from the ContentForm the business rule object that will provide the
populated dataset. I was going to try and use inheritance in a similar way to
that used in my Windows Applications but I've just noticed that MasterForm
doesn't inherit from Page and that, I think, blows that approach out of the
water!
Any ideas?
forms. For instance a "List Template" that includes a GridView and buttons to
Refresh, Display, Add, Modify and Delete record, all located in the correct
place with the correct visual characteristics and the correct event handlers
already wired up and with the appropriate code already in place to
(consistantly) test for things like "you can't display that record because
someone else has deleted it".
As a Windows Application I would do this by creating a base class that
includes these characteristics and then I would inherit from it to create my
concrete forms. The base class would include some MustOverride methods that
would delegate to the derived classes to retrieve things like the required
dataset and the business rule object required to fill and update it.
I'd like to do something similar in asp. I've played around with MasterForms
and these appear to provide everything necessary from a visual perspective.
However, I can't find a way to implement event handlers in the MasterForm
that can call methods in the ContentForm. I think I will need to do this so
that when, for instance, the Refresh button is clicked, the MasterForm can
retrieve from the ContentForm the business rule object that will provide the
populated dataset. I was going to try and use inheritance in a similar way to
that used in my Windows Applications but I've just noticed that MasterForm
doesn't inherit from Page and that, I think, blows that approach out of the
water!
Any ideas?