Microsoft.Web.UI.WebControls Treeview not rendering on some machines

天大地大妈咪最大 提交于 2019-12-09 23:19:58

问题


We have a simple web page which displays a treeview ( Microsoft.Web.UI.WebControls )

Now, on some machines (mainly the clients ones ;-) ) the treeview isn't rendered properly :

I've tested this on all my machines, even linux, and everything is rendered correctly here. I can reproduce this error though by removing or renaming the 'webctrl_client' folder.

I don't understand however what this problem can be? The 'webctrl_client' folder is correctly installed in the root www folder, and the .dll is also properly placed? I tried clearing the browsers cache but that doesn't seem to have any effect either ....

Doen anyone have any idea what could be going on?


回答1:


Microsoft.Web.UI.WebControls.Treeview is an obsolete control.

The most likely reason why your tree control breaks is that it does not work on Windows 8/IE10.

Best option is to convert to System.Web.UI.WebControl.TreeView

Quick fix: add the following code to your Global.asax.vb.Application_EndRequest. This will force IE to load your application in compatibility mode.

Try

   Response.AddHeader("X-UA-Compatible", "IE=5")

Catch ex As Exception

End Try

You may also read this article on how to make sure your server recognizes IE10: http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx

More explanation: Microsoft removed support for HTC behavior files in IE10 (https://msdn.microsoft.com/en-us/library/hh801216(v=vs.85).aspx). HTCs was the old way of extending browser's capabilities. Microsoft TreeView uses HTCs (found in webctrl_client folder) with no fallback. Other browsers do still seem to support HTCs.



来源:https://stackoverflow.com/questions/15927236/microsoft-web-ui-webcontrols-treeview-not-rendering-on-some-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!