I have a master page ‘Master1’ and i have used a content place holder ‘content1’ and loads
pages ‘Page1’ and ‘page2’ in the ‘content1’. Is there any way to identify which page is loaded to the content place holder whether it is ‘Page1’ or ‘Page2’ dynamically.
I have a master page ‘Master1’ and i have used a content place holder
Share
I think maybe you have misunderstood how master pages work?
In you master page you define the guts of your page that you want all pages to share, like headers and footers etc. The you define a content holder:
The contents of Page1.aspx etc will be injected into that
ContentPlaceHolder.Then in your aspx pages you simply define which master page it should use:
and then define the content that should be injected in to the place holder in the master:
Note the id used for the
ContentPlaceHolderIDproperty, so that it gets injected into the right place – the master page could have several place holders. So both Page1.aspx and Page2.aspx can be loaded in to the place holder, all you have to do is navigate to whichever page you want to display. Nothing needs to be done on the master page.