Blank ASPX page rendered - asp.net

My web application has one page default.aspx that renders a blank html.
I have some CSS and Javascript files included into the page, but in the browser if I see view source then it shows only:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
Sometimes it works...but most of the time it doesn't. Refresh doesn't help either.
Whereas there are plenty of Link references and JavaScript references, none of them are included into the page. I tried to put a debug pointer (and also logging from the page load) but it never gets a hit.
IIS - web dev server does not make any difference. I don't even think its a OS, IIS related issue. because the same code on another project working perfectly on the same machine.
By the way my JavaScript file has some un-usual characters in a string like:
Quote: '»',
DOT_ESCAPE : '_DOT_',
NL_ESCAPE: "↕"
Is it a problem or not? I have no idea even what's going on. Can anybody suggest something?

I have resolved this issue. The problem was the js file has wrong code page.

Related

IIS renders embedded font icons incorrectly

I have a static web page that displays icons embedded in one of the css references. The icons are not displayed properly and we see some junk characters instead when browsed to from IIS. The same web page when opened directly in the browser seems to render fine. I wonder if it is some misconfiguration in the static page website but I am unable to figure out what the issue could be. Would greatly appreciate any help to solve this issue.
The page when rendered by IIS:
The page when rendered by browser directly:
Looks like the CSS file is the issue.
The css file when browsed to via IIS:
The original css file opened with the browser:
If you use extended styles and sass syntax, when SASS does the compression, it changes Font Awesome characters from escaped ASCII sequences to unicode. So you need to add <meta charset="utf-8" /> in the head to let the browser know how to interpret it.

HTTP Meta Tags in SQL Server SSRS 2012 Web Pages

We have SQL Server 2012 with SSRS installed on Windows Server 2008.
There are some issues with reports not displaying correctly unless compatibility mode is enabled in IE 10.
We also have a development server with the same setup but there the reports load fine because all pages rendered by the report server have the following meta tag:
<META HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=5">
Our production server does not have this and I am trying to add the same meta tag there but can't figure out how and the person who originally setup our dev server is no longer here.
I tried looking at MSRS11.MSSQLSERVER\Reporting Services\ReportServerPages and editing ReportViewer.aspx but it doesn't matter how I modify the meta tag or even if I completely remove it from the file, all rendered pages still have the original one that I mentioned above.
I then tried looking in MSRS11.MSSQLSERVER\Reporting Services\ReportManager\Pages thinking that I can edit the individual files like Folder.aspx or Report.aspx but when I open those files all they contain is this:
<%# Page language="c#" Codebehind="Folder.aspx.cs" AutoEventWireup="false" Inherits="Microsoft.ReportingServices.UI.FolderPage" EnableEventValidation="false" %>
<%# Register TagPrefix="MSRS" Namespace="Microsoft.ReportingServices.UI" Assembly="ReportingServicesWebUserInterface" %>
So there is no place to add the meta tag.
I also looked in web.config and I don't see anything there that is adding the meta tag to all the pages.
I am not sure where else to look and can't figure out how the meta tag was added.
It's obviously not a default out of the box setting since it's not there on our production box.
I have found a workaround that seems to be working ok allthough the markup looks strange. You just simply add to ... \ReportManager\Pages\Report.aspx the markup bellow
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
</head>
When it is rendered the source contains both meta tags but it uses this one (teste on IE 11).

ASP.Net error - type is not compatible with the type of control

I have a web site i created using VS2012 web edition,
Running a VB.net asp web site,
In the VS2012 debug/release mode it compiles and everything works good,
When i upload it to a server (Windows server 2008 R2) I get the following error:
The base class includes the field 'html', but its type (System.Web.UI.HtmlControls.HtmlElement) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 4: <html id="html" xmlns="http://www.w3.org/1999/xhtml" dir="ltr" runat="server">
Line 5: <head id="Head1" runat="server">
Line 6: <title></title>
I looked a bit on the web and found this :
VS 2010: Value of type 'System.Web.UI.HtmlControls.HtmlGenericControl' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'
Installed it but no help,
The site i created was re-created from another vb.net project so i used a web.config with from the old one, maybe it has something to do with it, i have no "assembly" properties it this XML.
Other pages that are not related to that master page (that html tag is running on a master page...) work's fine.
OK,
So after trying a lot of stuff that didnt work i found a solution, i dont like this solution but it works,
I went to the page.designer.vb file, and then looked for the 'html' and 'Head1' properties that were generated there,
In there i replaced their types to System.Web.UI.HtmlControls.HtmlGenericControl
Afterwards, it worked.
Weird bug, nothing else (including the "hot fixes" that are mentioned in other posts helped.
Hope this would help some one out there .
Somehow the designer file and the markup file get out of sync, even if the types appear to match.
I changed the ID attribute of the problematic control, saved, and rebuilt in the markup file. I then changed it back to the original ID, saved, and rebuilt.
Problem goes away!
Weird issue it is I am not sure if there is a proper solution for this but what worked for me was simply changing the Control ID. and then designer.cs file was changed and all worked good.
I fixed it by Cleaning Solution/project -> Rebuild

How to convert .aspx pages and master pages to html pages?

I am doing one project in asp .net.Its completed,then the same project will be done in html5. How to convert the .aspx pages and master pages to html 5? Is it possible?If any one know please tell me.
You can technically make the page HTML5 by changing the doctype...
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
It is also recommended that you specify a lang attribute on the html tag and include the meta tag to define your character set.
This won't give you instant HTML5 semantics, but this is essentially step one. Using the right elements for the right kinds of content will be down to you, for example deciding when to use header, article, section, footer instead of plain div elements and so on.
You should also be able to select "DOCTYPE:HTML5" from the toolbar in Visual Studio - I don't know what version you are using, but I think in the previous version you could download a HTML5 language extension, I'm pretty sure it is included by default in Visual Studio 2012.
what you can do... if I understand your question correctly is, rightclick and say view page source and copy your html or install google chrome and the on each page you can go rightclick and inspect element. you can copy and paste the html of each page including the masterpage content. Its a sloppy way but will work if you only want the html
One of the way that i think you can do is to use http://modernizr.com/ kind of framework to switch between html5 and normal html easily .

Classic ASP page automatically sets Quriks mode as default in IE 8

While viewing the HTML IE 8 sets the default document mode as IE8 Standards as it should but it enters quirks mode on an asp page.
Even if I use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
it doesn't really help.
What should I do?
First thing I would do would be place identical output in a HTM file and visit that instead. If you get different results then there really is something wierd going on because I doubt IE8 has any way to treat "asp" any differently.
BTW, How do you know its actually going into quirksmode?
What happens if you use stronger DTD like this:-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Does it still remain in quirksmode?
You're not confusing IE7 compatibility with Quirksmode are you?
IE7 had a number of bugs in how it render even Standards mode HTML, perhaps what are seeing is IE7 compatibility instead.
Use fiddler to examine the headers being sent with the content. Is there a header like this:-
X-UA-Compatible: IE=EmulateIE7
in the response?
Is the Compatibility button present next to address in the brower UI?
The only thing that actually works is <meta http-equiv="X-UA-Compatible" content="IE=8"/>, other browsers will ignore it but IE will be forced to be in IE-8 mode unless you've done something really stupid like putting something before the HTML.
I write standards based classic ASP all the time. The things to check would be your HTTP headers. Make sure something isn't being inserted into your HTTP header to cause it to use quirks mode. Might check your IIS box to make sure there isn't something being sent in the "Custom HTTP Headers" section in IIS. Also, check that your doctype is indeed correct. Lastly, make sure that you do not have any of IE's special meta tags that can change the rendering mode. Just because classic ASP is old doesn't mean that the browser would display it any different than any other HTML page. Honestly the browser doesn't really even care what the extension is. If it is served as html mime type then it will render as such.

Resources