c# - Content Page does not have content of Master Page -
c# - Content Page does not have content of Master Page -
master page content :
<form id="form1" runat="server"> <div> <asp:contentplaceholder id="contentplaceholder1" runat="server"> <center> <table border="0" cellspacing="0" style="border-collapse: collapse; border-top-width:0" bordercolor="red" width="970" bgcolor="#dde1ee" cellpadding="0"> //all contents </table> </center> </asp:contentplaceholder> </div> </form>
content page:
<%@ page title="" language="c#" masterpagefile="~/cambridgemaster.master" autoeventwireup="true" codefile="home.aspx.cs" inherits="home" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <asp:button id="button1" runat="server" text="button" /> </asp:content>
in content page, unable find master page content.
it works bit differently.
it injects content of content page contentplaceholders (effectively replacing there).
you can set contentplaceholder want content page html appear.
<center> <table border="0" cellspacing="0" style="border-collapse: collapse; border-top-width:0" bordercolor="red" width="970" bgcolor="#dde1ee" cellpadding="0"> //all contents <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> </table> </center>
note i've placed within table , left empty.
c# asp.net master-pages
Comments
Post a Comment