Last post Apr 25, 2007 10:29 AM by mikener
Apr 23, 2007 12:33 PM|mikener|LINK
I have a web page that has several controls with their corresponding event handlers on them. Since 99% of my pages are going to have the same controls and event handlers, I was wondering if it would be possible
to create a base web page that contains these controls/events that all my other pages can inherit from? If it is possible can someone give me an example of how this is done (I have tried a few ideas but they failed to work)?
Thanks so much.
Apr 23, 2007 12:48 PM|Girijesh|LINK
Use master and content page in asp.net 2.0
Put the base controls into the master page.
Apr 24, 2007 09:55 PM|Jessica Cao - MSFT|LINK
If you are using ASP.NET2.0, I am afraid you cannot do the inheritance. Because the page class is generated at run time and you never know what is at the design time.
A good choice is using MasterPage, see this tutorial
Hope it helps,
Apr 25, 2007 10:29 AM|mikener|LINK
Thanks to the both of you. I had not thought of using the MasterPage to accomplish this.