Search code examples
asp.netmaster-pages

How to make a master page inherit only one feature from another master page


I have 2 masterpages called User.Master and Admin.Master. Admin.Master as the name suggests is for administrator and User.Master is for users. The User.Master has Login and Sign-Out functionality and a sidebar of its own. The Admin.Master has a sidebar of its own. Now I want the Admin.Master to inherit Login and Sign-Out functionality but not the User.Master's sidebar. How can I achieve that?


Solution

  • Create a third master page, LogInOut.master, which includes the login and logout stuff, and from which you then derive both User.master and Admin.master, providing each with their specific sidebar.