Visual Studio weirdness - asp.net

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.

Related

Stylesheet delayed on firefox

My asp.net MVC application use bundling to render stylesheet in my _Layout Page. Once my application deployed, I use Firefox and navigate to my login page and got this weird behavior I can't explain.
When I clear firefox cache to force reload stylesheet from server, I first see my page without any style applied. Then once the stylesheet is loaded, style are applied wich cause some unwanted 'flickering'. On chrome an IE, nothing is displayed before stylesheets are loaded, so no flickering here. I also have a really similar web app on my server for which, when I browse it with firefox, the 'flickering' problem doesn't occur. So I guess it must be something, maybe the order of code blocks in my page, that causes this behavior, not only the browser.
Is there a place where whe can look into your code? It's kinda hard to give an answer by just this question and information. The problem can be caused by alot of possibilities.
Did you try viewing the application on another computer? Sometimes that can be handy to determine if the issue is local (or is a general issue).
If there is a link to share, that would be great.

Chrome print preview changes styling of web page

Short Version:
I am using Chrome 27.0.1453.94 on Windows 7 Pro
I go to http://www.try-phpbb.com/30x/ using Chrome
I select Print... | Save as PDF
The print preview looks nothing like the web page - layout, links, fonts all wrong.
Why?
How can I fix this to make the PDF styled the same way as the web site?
Long Version:
I am a member of a secure forum (ie have to log in for access), which is base on the phpBB forum template (https://www.phpbb.com/). Our forum will be cleared of all threads and posts soon to make room for the next round of subscribers.
We have been given permission (even encouraged) by the moderators to download the contents of each topic/thread/post and write them into PDF files so we can keep referencing them in the future. We have to do this ourselves, and I volunteered to do the work as I have an IT background. But its proving harder than I thought.
I was hoping to do the following this process...
Download and add "Stylish" Chrome Extension
(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe)
Add CSS code to Stylish to modify the appearance of the forum pages ready for PDF migration
In Chrome use Print | Save as PDF option to save styled page as a PDF doc
For multi-page forums, repeat this process for each page and then use PDFMate (or similar) to concatenate the PDF docs together into a single long PDF.
Steps 1, 2 and 4 are working perfectly, but step 3 is not.
The print preview in Chrome screws up the appearance of the forum pages. Layout styling is lost, fonts are completely different, links are missing or look terrible. For example, try printing this page (http://www.try-phpbb.com/30x/) - it looks completely different in print preview to how it looks in the browser.
Is there something I can do to fix this? Can I somehow give the print preview version some CSS code to restyle it? Anyone know why this would be happening?
Or alternatively, can you suggest another solution to convert HTML to PDF? I have tried Chrome extensions "iWeb2x" and "Send to Google Drive", but with no success - because the forum is secured, the PDF file they create is the forum's Login page, not the forum thread page I'm currently looking at.
Any help greatly appreciated - thanks.
Have a look here, maybe it's helpful
http://www.smashingmagazine.com/2011/11/24/how-to-set-up-a-print-style-sheet/
You can set your own css style for the printed page.
Hope it helps, regards
I had a case, where if the iframe is display:none, the css is not loaded, thus not printing the correct CSS style. You can fix it with visibility:hidden; And size zero

Crystal report is making the menu for master page disappear

For some reason whenever I go to the page of my website that has the crystal report on it my main navigation bar disappears. Here is what the header for the site (with the navigation menu) is suppose to look like:
and here is what it looks like when there is a report on the page:
Could someone tell me what is causing this and how I can fix it?
I'm using master page for the header by the way.
Greener, the Crystal Report viewer is a dynamic HTML representation of the report. It combines JavaScript, HTML and CSS (duh, what doesn't) to represent your report on the webpage. The toolbars are powered by JavaScript calls to .JS that is linked in when the CrystalReportViewer control is rendered to your page.
My point is, all of this introduces a LOT of stuff that can conflict with your existing page. In particular JavaScript errors can occur (which can cause certain things to stop rendering) OR CSS the report uses happens to apply styles you never intended to have applied to objects in your page.
I highly recommend installing the Web Developer toolbar and/or FireBug to FireFox, IE, or whatever browser they are offered on these days. FireFox's implementation of those is quite good in my experience.
When the page loads you can use the 'CSS' menu of the Web Developer toolbar to actually disable some or ALL the styles applied to the page. If disabling Crystal related styles (or all) makes your missing toolbar appear, then it's probably a conflict in your CSS. A front end developer would know to adjust the styles (i.e. add the !important directive to a style, change class/id names, etc.) to address this.
Alternatively, FireBug may be reporting JavaScript errors (heck, even FireFox can show these in the console) which could indicate a problem that prevents the completion of rendering your toolbar.
An outside possibility is that the report itself contains mark-up. For example, if you had certain fields in the report contain HTML that happened to be rendered by the browser, this could create an open div tag, css styles and even JavaScript that would do all the stuff I explained above.
I hope this narrows it down for you. Happy troubleshooting!
I was having the same issue and after hours of searching I finally resolved it... check this out... http://scn.sap.com/thread/1926659
In the crystalreportviewer css file, I adjusted the div class = clear and changed the height attribute and disabled overflow:hidden. Hopefully, that works for you. Good luck!
I found the solution after searching on the web and is a quite simple.
On the Site Master, change the Name for all the places you have the style "clear" for example "clear1" and change it too en the site.css with that name.
The problem is for the conflic with the namespaces with Crystal Report css.
Hope this help.

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.

CSS not displayed depending on page

I have a friend that has a really strange issue with my website. When he clicks on http://www.copeo.fr/ the page displays fine but when he clicks on a link like www.copeo.fr/user/ the CSS is not applied even after a refresh. The raw html does display.
I asked him to display the CSS that is hosted on amazon S3 hcopeoressources.s3.amazonaws.com/style/futurvert/style.css and it displays fine.
The code validates on W3C validator so does the CSS. I am lost what could be the origin of the issue. Could it be its enterprise cache? configuration of IE7 on his machine?
If it happens to someone else who could explain the issue to me, I am all hears.
Thanks
Ok got my answer. The firewall blocked the CSS that is stored on amazonaws and for the first page, it was a cache that was filled outside of the company firewall.
Sounds like he is using relative path names. /foo/bar.css will resolve to sitename.com/foo/bar.css but foo/bar.css will resolve to sitename.com/currentpath/foo/bar.css.
There is an IE bug that if you have more than 30 style sheets, some or all of them won't show:
http://support.microsoft.com/kb/262161
It could possibly have something to do with that.
When I hit the CSS URL I got:
"This XML file does not appear to have any style information associated with it. The document tree is shown below"
We use S3 at work for this type of thing and don't have issues, but I think pulling the CSS file off amazon S3 and storing it on a more traditional server might help with your trouble shooting. Or even solve the issue.

Resources