Net4.0的網站在IE10、IE11出現“__doPostBack未定義”的解決辦法。
阿新 • • 發佈:2019-02-15
方法一、瀏覽器設定成相容模式。
方法三、點選VS的工具選單--》庫程式包管理器--》程式包管理器控制檯(如果沒有“庫程式包管理器”的選單,就先點那個“擴充套件管理器”,安裝一個叫“NuGet程式包管理器”,然後就會有了。),點選後下面會出現一個連線PowerShell的控制檯,等控制檯載入完畢後輸入
install-package App_BrowsersUpdate 回車
等待安裝完成後,網站根目錄下面會出現一個App_BrowsersUpdate目錄。然後再訪問就不會出現“__doPostBack未定義”的錯誤提示了。
以上的方法三解決不了IE11 在NET4.0下出現“__doPostBack未定義”的辦法。
IE11的解決方法是(下面方法二選一):
二、在上面方法三生成的App_Browsers\ie.browser新增以下文字,在頂部的<browsers>下面:
[html] view plaincopyprint?- <browserid="IE11"parentID="Mozilla">
- <identification>
- <userAgentmatch="Trident\/7.0; rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)"
- <userAgentnonMatch="IEMobile"/>
- </identification>
- <capture>
- <userAgentmatch="Trident/(?'layoutVersion'\d+)"/>
- </capture>
- <capabilities>
- <capabilityname="browser"value="IE"/>
- <capabilityname="layoutEngine"value="Trident"/>
- <capability
- <capabilityname="extra"value="${extra}"/>
- <capabilityname="isColor"value="true"/>
- <capabilityname="letters"value="${letters}"/>
- <capabilityname="majorversion"value="${major}"/>
- <capabilityname="minorversion"value="${minor}"/>
- <capabilityname="screenBitDepth"value="8"/>
- <capabilityname="type"value="IE${major}"/>
- <capabilityname="version"value="${version}"/>
- </capabilities>
- </browser>
- <!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11,0) like Gecko -->
- <browserid="IE110"parentID="IE11">
- <identification>
- <capabilityname="majorversion"match="11"/>
- </identification>
- <capabilities>
- <capabilityname="ecmascriptversion"value="3.0"/>
- <capabilityname="jscriptversion"value="5.6"/>
- <capabilityname="javascript"value="true"/>
- <capabilityname="javascriptversion"value="1.5"/>
- <capabilityname="msdomversion"value="${majorversion}.${minorversion}"/>
- <capabilityname="w3cdomversion"value="1.0"/>
- <capabilityname="ExchangeOmaSupported"value="true"/>
- <capabilityname="activexcontrols"value="true"/>
- <capabilityname="backgroundsounds"value="true"/>
- <capabilityname="cookies"value="true"/>
- <capabilityname="frames"value="true"/>
- <capabilityname="javaapplets"value="true"/>
- <capabilityname="supportsCallback"value="true"/>
- <capabilityname="supportsFileUpload"value="true"/>
- <capabilityname="supportsMultilineTextBoxDisplay"value="true"/>
- <capabilityname="supportsMaintainScrollPositionOnPostback"value="true"/>
- <capabilityname="supportsVCard"value="true"/>
- <capabilityname="supportsXmlHttp"value="true"/>
- <capabilityname="tables"value="true"/>
- <capabilityname="supportsAccessKeyAttribute"value="true"/>
- <capabilityname="tagwriter"value="System.Web.UI.HtmlTextWriter"/>
- <capabilityname="vbscript"value="true"/>
- </capabilities>
- </browser>
<browser id="IE11" parentID="Mozilla">
<identification>
<userAgent match="Trident\/7.0; rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" />
<userAgent nonMatch="IEMobile" />
</identification>
<capture>
<userAgent match="Trident/(?'layoutVersion'\d+)" />
</capture>
<capabilities>
<capability name="browser" value="IE" />
<capability name="layoutEngine" value="Trident" />
<capability name="layoutEngineVersion" value="${layoutVersion}" />
<capability name="extra" value="${extra}" />
<capability name="isColor" value="true" />
<capability name="letters" value="${letters}" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="screenBitDepth" value="8" />
<capability name="type" value="IE${major}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
<!-- Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11,0) like Gecko -->
<browser id="IE110" parentID="IE11">
<identification>
<capability name="majorversion" match="11" />
</identification>
<capabilities>
<capability name="ecmascriptversion" value="3.0" />
<capability name="jscriptversion" value="5.6" />
<capability name="javascript" value="true" />
<capability name="javascriptversion" value="1.5" />
<capability name="msdomversion" value="${majorversion}.${minorversion}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="ExchangeOmaSupported" value="true" />
<capability name="activexcontrols" value="true" />
<capability name="backgroundsounds" value="true" />
<capability name="cookies" value="true" />
<capability name="frames" value="true" />
<capability name="javaapplets" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="supportsFileUpload" value="true" />
<capability name="supportsMultilineTextBoxDisplay" value="true" />
<capability name="supportsMaintainScrollPositionOnPostback" value="true" />
<capability name="supportsVCard" value="true" />
<capability name="supportsXmlHttp" value="true" />
<capability name="tables" value="true" />
<capability name="supportsAccessKeyAttribute" value="true" />
<capability name="tagwriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="vbscript" value="true" />
</capabilities>
</browser>