Master page issue in asp.net after publishing - asp.net

I am facing a unique issue with my application.
In my master page, I have few CSS scripts tag and some coding to display some text on the Master page and everything is working fine.
but when I am publishing the same website, on same server and opening it on the same browser, I can see that all the CSS which I have written on the Master Page is vanished.
I have no idea what happened...

The code snippet you provided indicates the text is white. White text on a white background isn't the problem, is it?
We could help you better if you could provide a more complete code sample.

Related

Mobile website in HTML5 not pulling CSS file until refreshed

I'm building a contact form for a mobile website in HTML5 and CSS. It is the same form I use on all mobile website and after not working for 5 hours I pulled the code straight from a working site I built and it still doesn't work properly.
The issue is when you go to the contact page it shows the contact form, but with the labels centered and the submit button image isn't showing up. I must refresh for it to bring up the correct CSS file to align the text left and show the submit button. Initially I thought it was from a CSS/JS conflict with my menu at the top so I pulled that and it still causes the same problem. I have cleared the cashe on my phone and web browsers and they all work the same.
Here is the link: www.lpokc.org/mobi/contact.php after going to this page hit refresh and you will see the difference.
My question is, is this a caching issue, is it server side issue, or is it a conflict in my coding. I'm not good with posting the code on this site but if you go to the mobile site from your web browser you can just right click and view source to see my code. I have a boiler plate html core file with boiler plate CSS and custom CSS.
Is there some sort of script I could use to make this page auto refresh one time on page load then not again after the reload? I don't want to use an improper fix like this but I have been working on this issue for a day.
The left side is before refresh. I have pulled the code from the site now but I think it was a js conflict because it was auto loading the css from the menu when the link for any page was clicked.
I'm seeing it fine on my end. Seems to work flawlessly, but if you are still having a problem, you could either use cookie or session variables. If the variable does not exist, you can use the php function header( 'Location: http://www.lpokc.org/mobi/contact.php' ) ; to "refresh" the page. It's actually just a redirect command, but if you are sending them back to the page they are on, it is pretty much the same thing as a refresh.
It was a conflicting issue with my menu JS/CSS. I pulled it and now everything works fine.

ASP/HTML/CSS - Design View Different from Browser Preview

I'm getting a difference in my design view and what the actual preview displays. I'm pretty sure my code is correctly reflecting what appears in the design view, but incorrectly in the browser preview. Any suggestions on how I can fix this and why this is happening? The black content area should be below the header and buttons.
Master Page Design View: http://imageshack.us/photo/my-images/30/designview.jpg/
Browser Preview: http://imageshack.us/photo/my-images/638/browserpreviewz.jpg/
IE and Chrome both display the same behavior.
Here is the code of the master page: (because of '<' I'm having getting asp code in here...how do I enter it in as code sample?)
Personally, I find i can never trust the web preview in visual Studio, so while this is not really an answer to your specific question I recommend you always use an actual browser for preview. :)
Your CSS might be cached. When you are looking at the web preview, It is worth a try to reload the page and the CSS by clicking ctrl-F5 (not just F5). This worked for me a few times when I felt that my CSS changes are not being rendered in the web preview.

Design Page cannot be viewed!

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.

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