I downloaded Firefox 4 yesterday and when I try to open my site (ASP .Net 2.0 site using masterpages) it tries to open the file rather than display the page. The message in the popup is: "You have chosen to open contactus.aspx which is a: aspx File from: 'my site'. What should Firefox do with this file?"
I am sending the following content-type: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> I also tried changing the charset to utf-8, same thing.
When I try to run the page through the w3 validator it gives me this message:
Warning Character Encoding mismatch!
The character encoding specified in the HTTP header (utf-8) is different from the value in the <meta> element (iso-8859-1). I will use the value from the HTTP header (utf-8) for this validation.
Is the server (IIS) somehow setting the default charset? Could this mismatch be the problem? What else can I look for? Also, one more thing, I have a mobile site running on the same server which uses "application/xhtml+xml; charset=utf-8" as the content-type and it works fine in FF4. Thanks!
Edit: here is an example page from the site: http://www.cvps.com/jobs.aspx
Edit 2: I think I have narrowed down the problem to the mobile detection. I am using 51 degrees mobile device detection from http://51degrees.codeplex.com/
Specifying the content type in a meta tag won't help - the browser needs to answer the question of what type it is before it looks at the contents of the file. You need to specify the content type in the server config.
Encoding can be usefully specified in the meta tag, but I'd still prefer to have it right in the server config.
The problem turned out to be with the mobile detection framework I am using (51degrees.mobi). I found a post on their support forums here that was similar to my problem and was able to fix the problem.
Related
I am using ASP.NET platform to create a web page. Inside the page i have used some images/icons. For security purpose i have used “X-Content-Type-Options: nosniff” in web.config file. When i deploy the web page in IE, some of the images/icons isn't rendered. But, the same page working fine in Firefox and Chrome.
When i remove the statement “X-Content-Type-Options: nosniff” from web.config everything is working fine in IE. But, for security purpose i must use that statement. At the same time the missing images/icons need to be rendered in IE.
So, can anyone help me how to fix the issue with the statement “X-Content-Type-Options: nosniff".
Thanks in advance,
The nosniff only applies to "script" and "style" types. Also applying nosniff to images turned out to be incompatible with existing web sites.
So "X-Content-Type-Options nosniff" would bypass the problem for images and here comes the browser role which fail to render the image if the type mentioned by the server is not matching the real file extension.
Refer to:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options.
and this:
https://msdn.microsoft.com/en-us/library/gg622941(v=vs.85).aspx
IE uses MIME information to determine how to handle files sent by a Web server. For example, when Windows Internet Explorer receives a .jpg file, the user sees the file in an Windows Internet Explorer window. The MIME Handling Restrictions feature helps prevent script injection attacks against Web servers by ensuring that any content delivered with an IMAGE MIME is not treated as HTML or XML.
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/dd565640(v=vs.85)
Add following line before saving bitmap
Response.ContentType = "image/gif";
I get an exception after clicking on a button or performing somekind of ajax operation inside AjaxPanel.
SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
< !DOCTYPE html>.
Telerik.Web.UI.WebResource.axd, line 15 character 16238
On ASP.NET 4.0 with Telerik. This happens only on IE10. Meaning - works perfectly on chrome, Mozilla, previous IE.
I applied the hotfixes KB2600088 and KB2783767 on the server but still nothing. This is Windows Server 2003 Standard Edition 32-bit.
What can I do?
clicking on a button or
What can I do?
If you are modifying the HttpResponse state, it is necessary to move this "button"
from the Telerik AjaxPanel/MS UpdatePanel.
See the Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it blog post for more information.
This problem is related to ajax request cycle and the problem solution is in webresources cache object is being treated by browser as unhandled request.
to resolve the problem the call trace must be captured using any web resource monitor and it is always advised to have request with timestamp or unique identifier.
unmannaged ajax requests under browser shows this type of error sometimes this also shows 500 error.
Thanks
I faced to this error few months ago when I migrate from IE 9 to IE 10.
It seems there is(are) an(some) incompatibility issue(s) between ASP.NET AJAX Client Library 4.x and IE 10.
I found changing compatibility settings of IE, would resolve my problem. I added following line:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
at top of my page as first line of html head section, before every other tags (as follow),
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
...
PageRequestManagerParserErrorException never occurred again, but some IE10 specific CSS3 rules did not affect because of changed compatibility setting.
I recently wrote this situation to Microsoft Connect and they told they are investigating.
I am running an ASP.NET WebForms blog engine web site at maxpavlov.com
I am writing mostly in Russian on my blog. Sometimes, even though I am writing a perfectly normal Russian characters in, when I view the resulting rendered blog post page, I get some symbols substituted with �� characters.
I started digging. First, I have checked to see if a UTF-8 is set as a response encoding in the globalization section in web.config. It always was. Then I have noticed, that the pages my site generate don't have a <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> attibute provided in the page header. So I have added it to both masterpages (the display one, and the admin one - it is blogengine.net's specific stuff).
Now all pages that the web server generates have the charset value set to UTF-8, but the problem remains.
The site, when I create a blog post saves it to XML file, that also has an encoding set at the top of the XML file to UTF-8 with the following line:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
Still, problem characters appear in the browsers, when I go to my site.
Where else should I fix this encoding problem?
More info: Fiddler tells me that the response header Content-Type: text/html; charset=utf-8
What is interesting, is that in different browsers, different characters in the HTTP Response get substituted with a �.
By the way, if anyone still wonders what the thing is - it's IIS Native RewriteModule. It's buggy even in version 2, if you disable it for the site, the problem goes away. Tried to report it in IIS.net - didn't believe me. Just learned to live without it on web sites that need to display a cyrillic characters.
Try using Windows-1251 (cyrillic) encoding for the russian alphabet.
in order to find the server spec. i've created a file in the root dir in my website called spec.htm and entered this content as i was offered by another user:
<html>
<head>
<title></title>
</head>
<body>
#ServerInfo.GetHtml()
</body>
</html>
but i only get a copy of the code in my browser and it doesn't run it,
what the problem might be?
EDIT: i think that the problem is that i'm not using IIS.
is there a way to do so without using IIS?
thanks
Please see the following article
http://www.asp.net/webmatrix/tutorials/14-introduction-to-debugging
The ServerInfo helper is a diagnostic tool that gives you an overview of information about the web server environment that hosts your page. It also shows you HTTP request information that is sent when a browser requests the page. The ServerInfo helper displays the current user identity, the type of browser that made the request, and so on. This kind of information can help you troubleshoot common issues.
Create a new web page named ServerInfo.cshtml.
At the end of the page, just before the closing tag, add the following highlighted code.
#ServerInfo.GetHtml()
Note, it appears as though this is designed to run in IIS only and not on Linux / Apache servers.
Note, this is a RAZOR syntax so your system needs to be able to run Razor by installing the WebMatrix
#ServerInfo.GetHtml() is a Razor view engine syntax. Try saving your file as .cshtml or .vbhtml
The problem is that your webserver is not set up to serve HTML files through the ASP.NET interpreter. Change the extension to .aspx (i.e., use the same code, but call it spec.aspx).
Are you setting the Content-Type header correctly. If not set to text/html or similar, the browser or framework may set the content-type to text/plain which will not render the html at all.
You can check this in Firebug in the Net tab, expanding the response that is associated with the page you are serving, and looking in the Headers tab. If the Content-Type header is anything besides text/html or text/xhtml, then you need to find a way to make your web server set that header properly
let me guess its just showing up "#ServerInfo.GetHtml()" on a webpage. This does nothing if you put it simply in a body tag of a html page. If you are running IIS make sure you are saving as .aspx and not .html
See "yourhtmlsource.com/myfirstsite/myfirstpage.html"
I hope I am understanding the question and this helps. I found it on the web page given above.
When you double-click a file on your computer’s desktop, the computer knows what program to open the file in by checking the file’s “extension”. A txt file will open in a text editor.
You need to give your document a file extension of ”.html”, which will tell it to open the file in your web browser, such as Internet Explorer, Firefox or Safari.
Right now you should be editing your HTML page in a text editor, which normally saves files with the extension “.txt”. We want to make it save in “.html”. In your text editor click File → Save As…. If you use Microsoft Windows, there will be a box labelled “save as type”; change it to “all files .”. This means that you can save the data (in this case, some text) into any format. Now type in the name index.html for your file and click save. Ex: file.txt becomes file.html.
We have two servers, a development/test server (Win Server 2008) and a live server (Win Server 2003 SP2). Same ASP.NET code base deployed to both, everything works fine Except when printing on IE 8 using the live server.
The live server prints the content shifted to the right in a larger font size.
I just don't get it! It is worth noting that we are using a specific css file for printing:
<link href="/css/print.css" type="text/css" rel="stylesheet" media="print" />
Both servers are producing identical HTML source. I am not even sure where to start looking for trouble.
If the HTML is the same then it's probably the HTTP headers that differ. Check them. It may be a MIME-type issue or something like that.
I once had a web browser ignore my CSS file because the server was sending the wrong MIME type for the CSS file.
Check what mode IE8 is using in each case. You can do this using IE8's developer tools (Press F12, it's in the menu bar at the top).
If they are different, this is likely caused byt HTTP headers, as Artelius says.
It turns out, a body element's width was not set explicitly and for some reasons that triggered the original issue, until I figured that out I have forced IE7 emulation from IIS using http headers.