inheriting code behind in a web form

  • Thread starter Thread starter BillE
  • Start date Start date
B

BillE

Can I inherit from a web form?

I would like to reuse procedures in a web form base class code behind by
inheriting from it.

For example, I would like to have a HandleError function defined in the base
class code behind, which would then be available to any web forms code
behind which inherited the base web form code behind.

Is this supported? I can't find a way to do it.

Thanks!
Bill
 
Sure. If you create a base page class, you don't have to create a full page
by the way, only a base class that inherits from System.Web.UI.Page. You
have to ensure though that the method is not marked private as then it won't
inherit.
 
Back
Top