Click here to Skip to main content
15,937,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ssir !
I want to apply the masterpage to the default page in asp.net page in vs 2008.
when i copy the asp contentplaceholder block of the masterpage to the default.aspx then it shows the message that "asp contentplaceholder can only be used in masterpage."
Posted
Comments
write2varun 25-Sep-13 5:01am    
did you create the page without the master page

Error message it pretty clear,you can not use contentplaceholder in content pages. If your masterpage contains
XML
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>

Then to place content in this contentplaceholder,in content page your code should be like
C#
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
//your code goes here 
</asp:Content>

Regards....
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900