Design Page cannot be viewed! - asp.net

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 ?

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.
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.
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.

The problem is that your markup in invalid. Fix it.
You likely have an open tag, improperly nested tag, or malformed asp tag.

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.

In SharePoint designer, when you insert a MasterPage in customized form, you get this error.
If you remove the < script / > tag,
it works fine for me. Hope that will work for you too.

Related

Concrete5: Why does my block fail to save the first time?

I am using 5.6.3.4 and using Designer Content to create blocks. I have customised the blocks by adding tabs. Other than that, it's pretty straightforward and everything is functioning well.
My problem is when I try to add and save a new block the first time, it keeps showing me the 'loading' icon but does not save the block. If I refresh the page and try adding the block again, it works. Sometimes it happens randomly and when I refresh the page and save, it works. Is there anything that's causing this and how can I fix this?
I have all cache turned off and am trying this on my localhost. The site does not have any other add-ons installed other than Designer Content. The site is using Bootstrap.
Had same issue, which was caused by tracking pixel code(javascript error).
Changed script to display code only when page is not in edit mode

Report Viewer looks bad with master page?

I am using report viewer control with my web application, if I use it without master page it looks perfect but if i use it inside masterpage, it has lots of formatting and css issues. does anyone knows why?
Because it may some Css files affect the appearance of your reportviewer container ,so try to remove the CSS files one by one from your master page and check the look every time so that u know the exact file which cause your problem,after that you can make a custom style to your report viewer container .

strange issue: ASPX page showing javascript content as text

On one user's machine an ASPX page suddenly showed JavaScript code as text on the page. The original contents of the page were also showing half baked and broken. The user was using IE browser. Though I cannot post the contents of the page here, I will try to describe it as accurately as I can. In between the address bar and the actual beginning of the page, there was a cross-section showing some JavaScript text. The text appears to be the automatic JavaScript that is generated by ASP .NET for Validators. The JavaScript text, it seems is of the Validators used inside a User Control that is used on this page.
This issue has happened just one-off. Now the page is showing OK to the same user.
Though I am sure this must have been a bandwidth issue I have no evidence to prove this and nor able to regenerate the issue. And 'someone' claims that this might have been a hacking attempt.
Has anyone faced similar issue ? Is there anyway to conclusively prove that this to be a bandwidth issue and has nothing to do with code or anything on the server ?

Visual Studio weirdness

I have no one else to count unless this fantastic community, I know this is a non-programmer question but I can't figure it out why this is happening.
To a client I developed, using 960.GS a layout with a simple login user page / choose product / register products using .NET (ASP.NET 3.5) and all was ok, they agreed and I started ...
I then imported the HTML files I did and started to replace input with asp:TextBox's and the button into an asp:Button, really simple/basic stuff, but soon I click "View in Browser" I got my code all scrambled!
even if I see a XHTML 1.1 Strict Validated code, and CSS 2.1 Validate code
to try to get what's wrong, I put the ASPX file aside and open only the HTML page.
results are very different:
Opening directly in Firefox, with no web server:
alt text http://www.balexandre.com/temp/2009-11-22_1116.png
if I run the same page (exactly the same code) [HTML page, no ASP.NET page] through Cassini (Visual Studio Web Server) it shows .. ohh well...
alt text http://www.balexandre.com/temp/2009-11-22_1117.png
as well if I run that html page from IIS 7.5
alt text http://www.balexandre.com/temp/2009-11-22_1129.png
all 3 files above are the same page, being run through 2 different servers Cassini, IIS and the normal HTML render from Firefox.
using Firebug, all css loads well
screen cast: http://bit.ly/7ZBkuh (20 sec)
Does anyone have any idea for this behavior?
All help will be greatly appreciated, Thank you.
This looks like a css overflow problem. Are there any differences between the resultant markup/css from the browser (not the source file in the url bar) - eg, by comparing the "View page source" result? I suspect there will be. And i suspect that it's css related not markup.
It might help to run a diffing tool against your original HTML file and the output produced by your ASPX page. It will definitely be expected to see some differences, but it might still help you highlight what's going wrong.
This is only a guess, but perhaps the CSS styles that you are seeing in the ASP.NET-hosted pages are defined in the page, and the CSS styles that you are not seeing are defined in a separate CSS file?
If that is indeed the case, then the problem could be due to the way you have configured ASP.NET authentication in web.config. It may be serving up the HTML file but blocking the CSS file.

Master Page Error in Asp.net

When I create a new page in asp.net and try to include the master page, I cannot view the designer part as it shows an error : "Master Page Error".
Although the page runs without any errors, designing the page becomes difficult as I can't see the design. I can only view the source part of the page. This is very difficult for me to design my page properly.
Actually my master page is in another folder. Does it make any problem?
Are you running the code locally or on a server? If on a server, make sure it has the same version of the .Net framework that you are developing on in visual studio.
Another folder is not a problem.
You can try to make a new page and select masterpage on creation.
Probably the code in which you are referring to the master page is somehow corrupt.
Check if that works and if so alter the reference of the page giving the error.
Still giving an error after that, then alter your question with the page source so people can see what's going wrong.
Saw this on another post and it fixed it for me. Its crap and its a total hack, but it worked for me. Remove all # symbols from your master page. Problem is, I NEED these in my markup. It all worked fine in VS2005. Every page that had its own master page worked fine. It gave me the Master Pager Error - fix it in code view error when I opened it in VS2008.
Took out the # symbols and Voila!, went right to design view in VS2008.
If you have comments on your master page and there's a % in one of them, remove the % from your code and try again.
Can you view design view on the master page?
Do you have double nested master pages - these do not work.

Resources