asp.net theme skin not applied and Java scripts not run when app hosted on IIS 7.0/7.5 and browsed in some browsers

StackOverflow https://stackoverflow.com/questions/19727932

سؤال

This question was previously posted as “asp.net theme skin not applied when app hosted on IIS 7.5 and browsed in IE 10” and did not received any answer from guys here but I myself could resolve the issue.

As it was really frustrating and took me a lot of time to search and resolve, I decided to modify the question title and its description to address the case better and clearer for other people who may meet such issues.

So the case is;

An asp.net web app is developed and it works fine on development machine browsers but when it is hosted on a remote machine (specifically IIS 7.0 and newer version + .NET 4.0) then it does not perform correctly.

Themes (specifically skins) are not applied and some of client – side java scripts (specifically AJAX and jQuery extensions) are not even execute.

What’s wrong here?

هل كانت مفيدة؟

المحلول

Well as Scott Hanselman described in here, asp.net sometimes does not correctly identifies the browser due to a bug.

There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren't within those ranges any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript.

So I followed one of the solutions which he had addressed and the issue resolved. I’ve summarized it here for short cutting the path;

use NuGet to install the App_BrowsersUpdate package

then deploy your web app on hosting server and try it again.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top