Rashmi Sargar
Rashmi Sargar

Reputation: 61

<asp:Content> does not correspond with <asp:ContentPlaceholder>

My ASP.NET page was not showing the controls. It just shows that master page error

The page has one or more <asp:content> controls that do not correspond with <asp:ContentPlaceHolder controls in the Master Page

Upvotes: 1

Views: 8611

Answers (4)

Abdelrahman ELGAMAL
Abdelrahman ELGAMAL

Reputation: 434

The problem is that you must have a syntax error in the master.page's markup :

Ex) %²> in stead of %>

If you validate your markup, I'm sure thar this will solve your problem

PI. I has the same error & it works for me ;)

Upvotes: 0

Apollo
Apollo

Reputation: 2070

Remove comment (<%-- --%>) in the Master file, this worked for me.

Upvotes: 4

chridam
chridam

Reputation: 103365

Try setting

<title></title>

instead of

<title />

Upvotes: 5

Claudio Redi
Claudio Redi

Reputation: 68400

All your Content controls have to reference existing ContentPlaceHolders on master page

For instance, if you have on your page

<asp:Content ContentPlaceHolderID="Header" ID="Title" runat="server">

You must have something like this on your master page

<asp:ContentPlaceHolder ID="Header" runat="server" />

ContentPlaceHolderID is the property that must match against any ContentPlaceHolder ID on master page.

Upvotes: 3

Related Questions