inheriting code behind in a web form

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
 
M

Mark Fitzpatrick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top