문제

I have a master page where I am calling another sub-page using the <asp:Content></asp:Content>

  • Default.aspx + master = Homepage
  • why_choose.aspx + master = Subpage

Inside the Subpage I have a menu which other Subpages will also share, so instead of adding the menu in each Subpage, is there any way I can add a <asp:Content></asp:Content> within the Subpage itself to load the menu?

If so, how do I do that?

도움이 되었습니까?

해결책

I think maybe you are misinterpreting master pages.

For your described scenario, your master page, generally Site.master should contain your menu markup.

Now, any pages you create (Default.aspx, why_choose.aspx) and use your Site.master page will also include your menu, although the markup is not visible within these sub pages.

If you want to load some other content into these sub pages, you simply put that new content into the asp:contentplaceholder on the sub pages.

Read up some more on master pages here

다른 팁

try using an iframe element and loading your additional content in it.

iframe on w3schools

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top