Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net 4.0, JavaScript Not Outputted in IE 11
    primarykey
    data
    text
    <p>In our <code>ASP.Net 4.0</code> project, we're noticing that in <code>IE 11</code> only (both on <code>Windows 7 SP1</code> and <code>Windows 8.1</code>), some <code>JavaScript</code> is not being outputted by <code>ASP.Net</code>.</p> <p>For e.g. in <code>IE 10</code> and below, we see this:</p> <pre><code>&lt;select name="ctl00$ctl00$cpHeading$cpHeading$ucWebStoreHeader$lshSubjectHeader$ddlVersionList" onchange="javascript:setTimeout(&amp;#39;__doPostBack(\&amp;#39;ctl00$ctl00$cpHeading$cpHeading$ucWebStoreHeader$lshSubjectHeader$ddlVersionList\&amp;#39;,\&amp;#39;\&amp;#39;)&amp;#39;, 0)" id="ctl00_ctl00_cpHeading_cpHeading_ucWebStoreHeader_lshSubjectHeader_ddlVersionList"&gt; </code></pre> <p>While in <code>IE 11</code>:</p> <pre><code>&lt;select name="ctl00$ctl00$cpHeading$cpHeading$ucWebStoreHeader$lshSubjectHeader$ddlVersionList" id="ctl00_ctl00_cpHeading_cpHeading_ucWebStoreHeader_lshSubjectHeader_ddlVersionList"&gt; </code></pre> <p>We're setting this script using:</p> <pre class="lang-cs prettyprint-override"><code>Page.ClientScript.RegisterClientScriptBlock(GetType(), null, script, true); </code></pre> <p>Could this be because <code>.Net 4.0</code> does not have updated browser definition files to recognize <code>IE 11</code> with its non-"MSIE" user agent string?</p> <p>I went with that assumption and have tried <a href="https://stackoverflow.com/a/18651046/2824636">Scott Hanselman's suggestion</a> of installing KB2836939 on both a Win 7 SP1 and a Win Server 2008 R2 on the machine that hosts the web app, but I don't notice updates to any .browser files in <em>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers</em> or <em>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers</em>.</p> <p>So, I ended up creating my own .browser file, placed it in the folders above and AppBrowsers without luck (ran <code>aspnet_regbrowsers –i and iisreset</code>). Here’s the content of the <strong>IE11.browser</strong> file I placed in the folders:</p> <pre class="lang-xml prettyprint-override"><code>&lt;browsers&gt; &lt;browser id="IE11" parentID="Mozilla"&gt; &lt;identification&gt; &lt;userAgent match="Trident/(?'layoutVersion'[7-9]|0*[1-9]\d+)(\.\d+)?;(.*;)?\s*rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)))" /&gt; &lt;userAgent nonMatch="IEMobile" /&gt; &lt;userAgent nonMatch="MSIE" /&gt; &lt;/identification&gt; &lt;capabilities&gt; &lt;capability name="browser" value="IE" /&gt; &lt;capability name="layoutEngine" value="Trident" /&gt; &lt;capability name="layoutEngineVersion" value="${layoutVersion}" /&gt; &lt;capability name="extra" value="${extra}" /&gt; &lt;capability name="isColor" value="true" /&gt; &lt;capability name="majorversion" value="${major}" /&gt; &lt;capability name="minorversion" value="${minor}" /&gt; &lt;capability name="screenBitDepth" value="8" /&gt; &lt;capability name="type" value="IE${major}" /&gt; &lt;capability name="version" value="${version}" /&gt; &lt;capability name="ecmascriptversion" value="3.0" /&gt; &lt;capability name="jscriptversion" value="6.0" /&gt; &lt;capability name="javascript" value="true" /&gt; &lt;capability name="javascriptversion" value="1.5" /&gt; &lt;capability name="msdomversion" value="${majorversion}.${minorversion}" /&gt; &lt;capability name="w3cdomversion" value="1.0" /&gt; &lt;capability name="ExchangeOmaSupported" value="true" /&gt; &lt;capability name="activexcontrols" value="true" /&gt; &lt;capability name="backgroundsounds" value="true" /&gt; &lt;capability name="cookies" value="true" /&gt; &lt;capability name="frames" value="true" /&gt; &lt;capability name="javaapplets" value="true" /&gt; &lt;capability name="supportsCallback" value="true" /&gt; &lt;capability name="supportsFileUpload" value="true" /&gt; &lt;capability name="supportsMultilineTextBoxDisplay" value="true" /&gt; &lt;capability name="supportsMaintainScrollPositionOnPostback" value="true" /&gt; &lt;capability name="supportsVCard" value="true" /&gt; &lt;capability name="supportsXmlHttp" value="true" /&gt; &lt;capability name="tables" value="true" /&gt; &lt;capability name="supportsAccessKeyAttribute" value="true" /&gt; &lt;capability name="tagwriter" value="System.Web.UI.HtmlTextWriter" /&gt; &lt;capability name="vbscript" value="true" /&gt; &lt;/capabilities&gt; &lt;/browser&gt; &lt;/browsers&gt; </code></pre> <p>Am I on the right track thinking that the missing JavaScript is because of IE 11 not being recognized by .Net 4.0? If yes, why is my .browser not taking effect?</p> <p>Everyone's time and help is much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload