Error when switching to design view: The page has one or more tags…

October 30, 2009

For tidiness, when using servers controls and HMTL tags that do no contain any content, I normally close the tag within itself, e.g:

Instead of: <asp:label id=”MyLabel” runat=”server”></label>

I use: <asp:label id=”MyLabel” runat=”server”/>

This has recently tripped me up when putting a master page together – I had the title tag as <title/>, with the tag written this way, when I tried to switch from source to design mode on a WebForm attached to the master page, I received the following error:

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

Solved simply by changing the <title/> tag to <title></title>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: