Weird characters rendering on IIS - asp.net

I need some help. I have an old website hosted on IIS 8.5 on a Windows Server 2012 R2 and today its not working anymore. The event viewer doesnt show any erros but if I inspect the code on Chrome or IE it renders like this:
And also sometimes it shows strange characters:
Does anyone knows whats happening and how to fix it? There is no new code or changes to the project.

If you can, try to restart IIS and see if that helps.
I've run into it a couple of times, often when multiple sites are hosted in the IIS. I don't know if it's the handlers or filters that eventually gets bogged down and starts to act wierd, and I've honestly not bothered to troubleshoot it further than restarting IIS, or in worst case, the server.

Related

Site functions locally, "Internet Explorer cannot display the webpage" on server

I have an ASP.Net Website (not a web app, fwiw) that builds and works just fine locally through IIS on my dev laptop.
However, when I publish it to our QA box and try to view while I'm remoting into that server, I get a message from IE saying "Internet Explorer cannot display the webpage". Firefox just spits back a quick "Connection Timed Out"
There is absolutely nothing in the event log nor the IIS log about this. I'm unsure where I can look for more info.
I'm fairly confident it is an ASP.Net issue. I can install a sample site from our vendor, Ektron, into IIS and it will run. If I overwrite the sample's web.config with my own, it continues to run. If I then blow away the entire sample site and copy over my site from my local, I'll get the message about how "Internet Explorer cannot display the webpage".
I've tried to keep the environments as close together as I can. Both boxes are running IIS 7.5 under an integrated app pool for .Net 4.0. I browse via localhost on dev and via an IP on the server.
I am not terribly familiar with the Website template, so I might be missing something obvious (I hope!). I'm hoping someone can provide some guidance into how I can get more info on what the heck is going on so I can resolve this issue.
UPDATE
I think I'm getting closer. By using Fiddler (thanks for the suggestion, Amy!) I notice that it redirects the request to SSL. SSL requires a different license from our vendor, so that might be it. I'm still trying to understand why that redirect is taking place, but at least I have something now to look at.
I'd look into the SSL settings in the web.config / IIS - settings for Mime Types and also into Ektron's MIME Types in the MimeType.config file. I found that some .aspx pages like (ekajaxtransform.aspx) weren't functioning correctly because of firewall/proxy issues/restrictions.
Hope it helps. :)

ASP.Net Forbidden URL with Internet Explorer

I have an issue here which has me baffled.
Another developer and myself developed an ASP.Net Web Forms application four years ago and the site has been live since. About 6 months ago we moved the application from a Windows 2003 web server using IIS 6, to a Windows 2008 web server using IIS 7.5. When we moved servers we tested the application again in the Firefox web browser, however, I can't remember if we also tested in Internet Explorer. We should have done.
Recently it has been brought to our attention that in Internet Explorer, when a user attempts to hit some of the pages within the website, they are presented with a
Forbidden URL
HTTP Error 403. The request URL is forbidden
I have also tried to recreate this error on my local computer and I also get an error
HTTP Error 400 - Bad Request
This only happens when using an Internet Explorer web browser, it works fine with the likes of Chrome, Firefox etc.
I am not sure how to fix this, but because myself and the other developer have not changed any of the source code, I don't think this is where the problem lies. I have a feeling it might have something to do with IIS on our new web server, but I am really not sure.
Has anyone else seen this problem before?
Any feedback would be greatly appreciated.
Thanks.
Folks, the problem for some reason was as follows:
When a user clicked a button on my site which would then redirect them to another page within the site, I previously had the following code to do so
Response.Redirect("../userprofile/myprofile.aspx")
However, after the release of IE 10, this redirect would no longer work, and instead I had to replace it with
Response.Redirect("~/userprofile/myprofile.aspx")
Hope this helps someone else who is having similar problems.

ASP.NET Development Server 403 Error

I'm developing a web application in Visual Studio 2010 on Win 7, and now seem to have a new error that has just popped up. When I try to access the site which uses Windows Authentication, in Firefox, I get a 403 error, with no subcodes. Up until this poijnt, it has been working this way just fine. Firefox prompts me for my credentials, and I enter them and then I get the 403 error. No problems with it in IE, just Firefox.
I've checked the network-trusted-ntlm-automatic key in Firefox and deleted my session cookie, but still no luck. The problem seems to be limited only to Firefox.
If I set the app to be Anon access, it works with no problems, but the app needs to be Windows Auth.
I attempted Local IIS, but there wasn't an option for Windows Auth for the app on my local IIS, so that kind of removed that option for the time being.
Any ideas out there for how to get this working correctly again? I'll take answers that get me the Windows Auth option in my local IIS as well, because that would also fix the problem for me.
Check to make sure directory browsing is not enabled for the site. Also, make sure your default documents are setup so when you go to: http://www.yoursite.com/ (notice the slash at the end of the url) a default document is loaded. I have seen in some cases where IIS thinks you want to browse the directory rather than load a page. See if you still get the 403 error by going to a specific page.
I'm running windows 7, 64bit with IIS 6.1.
To turn on Windows Authentication, go to Control Panel -> Administrative tools and select IIS Manager.
In the left panel, expand Sites, Default Web Site, and select your Virtual Directory. You should see Asp.Net in the top panel and IIS in the middle. The first icon under the IIS section is Authentication, double click this. You can then disable annon and enable windows by selecting from the drop down list and clicking Enable / Disable from the actions on the right side of the page.
Hope this helps.
After some digging I finally found the answer, but it wasn't where I expected it.
I was digging through Event Viewer trying to figure out why I kept getting Account Lockout messages when trying to load the site with Firefox and did some searching came across an article that specified how to add multiple servers to the Firefox network.automatic-ntlm-auth.trusted-uris key in about:config.
I had specified:
http://host1; http://host2
and instead should have separated with commas
http://host1, http://host2
I changed it to commas and reloaded and it is now working correctly with the Windows Authentication in Firefox.
Hopefully someone else finds this particular fix useful. Small typo, big headache.

Classic ASP on IIS 7

I am having problems with my app running on IIS 7. The application is a mixture of classic ASP and ASP.NET MVC (don't ask how and why).
Anyway, the application is up and running except for some problems that I am experiencing. For example, I have a button on my page and when I click it, javascript is opening a popup which needs to contain .asp page. But that doesn't happen. I get the blank popup with my cursor on busy as it still loads. This is happening almost always to me in IE. In Firefox it is much better but sometimes the app jams there too.
If I close the opened, blank popup, and I want to move around the application, my buttons in menu (which are also .asp) doesn't load properly. For example, I have different buttons for different sections and when I move around they should change. When I restart the browser, only then everything works normal for some time, but the problem occurs again after a while.
I am very sure that it is not the problem in application itself, because it works properly on the machines of my colleagues without those problems. They have the same OS (Vista Professional) and we compared the settings in IIS and they match.
So I am very confused, and I really don't know how to solve the problem. I found a bunch of articles and blog posts about classic ASP and IIS7 but most of them are about enabling asp, which I already did.
So I am suspecting that something wrong with IIS, but I don't know what, tried to reinstall it, hoping for some improvement, but I had no luck.
If you need more details please ask.
Does anyone have any idea what should I try or do?
When debugging ASP.NET or ASP apart from the VS itself the most important tool you need is Fiddler (free tool from MS). This allows you to observe the http sessions the occur between your server and the client. This tool will give much greater visibility on what is actually happening underneath.
Next Step
So you now know that the problem is server side and the URL of the resource causing the problem. The next step is to debug the server side process by attaching to the w3wp.exe that is serving your site. If the resource specified by the URL is an ASP paged attach for script debugging or if its ASP.NET attach for Managed Code debugging. (Note for ASP debugging you will need to enable ASP server side debugging in the ASP settings in IIS manager).
You should place a break point on the first entry point of code for the resource. Now you can step through the code and discover where it is locking up.

Why is LOGON_USER Server Variable is blank on New Windows / New Tab?

We are noticing some very strange behavior on an installation of a .NET2-based webapp on Server 2008. Our app uses old school Integrated Windows Authentication and simply reads the LOGIN_USER server variable from the request collection. There's a good reason for this, but that's somewhat irrelevant to the question, since the underlying WindowsAuthentication code from ASP.NET does the same thing.
Anyway...
When you enter the URL in the browser, it loads up just fine and displays the username (from LOGIN_USER) no problem.
When you click on a link within the web app, it loads the page just fine and authenticates without any problems.
When you hard refresh (Ctrl-F5) it also works just fine.
However, when you click open in a new window or open in a new tab, the LOGON_USER variable is blank
Any ideas? Am I missing some IIS7 setting somewhere?
Tested clients are Windows 7 with IE8 or Windows XP with IE6.
I experienced something very similar on IIS6 a few years ago. The issue then was caused by both anonymous and windows authentication being turned on for the site. Turning off anonymous authentication fixed the issue.
Though this was on IIS6 it might be something to look into.
The problem went away on it's own............ for now. After a reboot. Really. Shoulda thought to reboot earlier.
Also: anonymous auth was not enabled (otherwise, LOGON_USER would always be blank).
So, if you ever encounter this problem.... reboot!

Resources