views:

341

answers:

3

In Visual Studio 2008, while editing the web page, it is displaying some error and I cannot design my page in design view, I can do only in Source code. It is showing the following error in design view...

Master Page Error 'The Page Contains Markup that is not valid when attached to a master page Correct the problem in Code View'

Wat is the problem? Whr Should I change ?

A: 

The problem is that your markup in invalid. Fix it.

You likely have an open tag, improperly nested tag, or malformed asp tag.

DA
Tags are correct. Actually I used EnableEventValidation="false" in master page, but it shows error. So, I changed. Since that time, that web page is showing the error.. Wat to do for this?
Nila
+1  A: 

The problem is that you have edited the source code in such a way that it can no longer be shown in the designer.

Try undoing the latest change that you've made to see if that fixes the problem.

Check too to make sure that you have no <form>, <html>, <body> or <contentplaceholder> tags in your page. These will already be present in the master page, so there's no need for them in the sub-page.

Jeremy McGee
Ya.. One Error Occured, but I suddenly undo it. But, then too it is showing this error in that web page since two days. I can't able to edit in design view..
Nila
+1  A: 

Ok, you've got a master page and a content page and when you put the two together you get an error.

If the error isn't obvious you have to work to a point where you can identify what's caused the error - debugging but of pages rather than code.

  1. Create a new page that uses the same master page with no content - does that work? If so then the Master Page is probably not the issue.
  2. Now add the elements in your failing page one at a time to your new page - as close as you can manage to cutting and pasting from one to the next but one change at a time. At some point you should see the error arise in the new page - and at that point you should either be able to fix it or will be able to ask a more specific question about why it doesn't work.

It is the case that designers in VS can just gets themselves tied in knots - but there's usually an underlying cause.

Murph