What is relation between MasterPage and content page in term of OOPS?

Posted by Nik.d under ASP.NET on 11/12/2009 | Views : 2313 | Status : [Member] | Replies : 3
We have mater page and content in ASP.Net.
What kind of relation they share in the term of Oops?
Can any one describe it in details?




Responses

Posted by: Virendradugar on: 11/13/2009 [Member] [MVP] Silver

Up
0
Down
Master page works as a base class for the content page. So in terms of oops it's inheritance.

You can find more details about master page from below link
http://www.w3schools.com/aspnet/aspnet_masterpages.asp


Thanks,
Virendra Dugar

Nik.d, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nik.d on: 11/13/2009 [Member] Starter

Up
0
Down
Hi Virendra ,

Thanks for the quick reply.

But I am not agree with your answer.
As you said "inheritance" is there for mater page and content page.
If there is inheritance then page load of master page should called first but page load of content page is called first. As per OOP we can not change the base class at run time but we can change the mater page of content page at runtime.

Please let me know if I am missing something.

Hoping for accurate answer :)

Thanks,
Nikhil

Nik.d, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Virendradugar on: 11/13/2009 [Member] [MVP] Silver

Up
0
Down
Hi Nikhil,

Inheritance does not mean that always base class method will be called first. You have created instance of content page,so it is always going to call content page method first.

Yes, I agree with you regarding changing base class at run time. This is possible with Master Pages.

Again, It's not completely inheritance relation between Master Page & Content Page but it has some of the functionality of inheritance.

Hope this helps.

Thanks,
Virendra Dugar

Nik.d, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response