I have Page, MasterPage and UserControl in my project.
So I create basepage class and share some logic, then inherit from System.Web.UI.Page. My problem is I want use single basePage for any type of UI content.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can not inherit from multiple base classes in .NET, so you can not do what you are looking at here.
However, you probably do not need to do it.
Page,MasterPageandUserControlcan all access the currently renderingPageandMasterPageinstances via properties. You can then test their actual types and cast them appropriately, to gain access to the common code you need.