简体   繁体   English

Asp.net控件会基于客户端呈现HTML吗?

[英]Would Asp.net controls render HTML based on the client?

I have asp:menu control on my page. 我的页面上有asp:menu控件。 Never had any problems with it, until my Firefox was updated to v17. 直到我的Firefox更新到v17为止,它从未有任何问题。
The asp:menu control generates Table in asp.net 3.5. asp:menu控件在asp.net 3.5中生成Table。 But I have CssAdapter that generate unordered-list instead. 但是我有CssAdapter代替生成无序列表。 But on FF v17 its not working anymore. 但是在FF v17上它不再起作用。 IE & Chrome are good. IE和Chrome都不错。 I suspect the refID property for Firefox has something to do! 我怀疑Firefox的refID属性有关系!
I am running on Asp.Net 3.5, so there is no RenderMode property available. 我在Asp.Net 3.5上运行,所以没有可用的RenderMode属性。

Wow! 哇! That was simple, all I had to do was change browser refID from MozillaFirefox to Mozilla . 这很简单,我要做的就是将浏览器MozillaFirefoxMozillaFirefox更改为Mozilla

  <browser refID="Mozilla">
      <controlAdapters>
          <adapter controlType="System.Web.UI.WebControls.Menu"
                   adapterType="Test.Controls.MenuAdapter" />
      </controlAdapters>
  </browser>

Many asp.net webforms controls render based on browser capability, and the detection of browser capability is built on an engine meant to be updatable. 许多asp.net Webforms控件都是基于浏览器功能进行渲染的,而浏览器功能的检测是基于可更新的引擎构建的。

So, you can try updating your browser capability file (also known as browsercaps). 因此,您可以尝试更新浏览器功能文件(也称为browsercaps)。 Do this by downloading the latest browsercaps files from here: http://aspnet.codeplex.com/releases/view/41420 为此,请从此处下载最新的browsercaps文件: http : //aspnet.codeplex.com/releases/view/41420

You can update them machine-wide by putting them in the c:\\windows\\microsoft.net\\framework\\\\CONFIG\\ directory and overwriting what's there, or single-app by creating a app_browsers directory at the top level of your web app, and putting the files there. 您可以在机器范围内更新它们,方法是将它们放在c:\\ windows \\ microsoft.net \\ framework \\\\ CONFIG \\目录中并覆盖其中的内容,也可以通过在Web应用程序的顶层创建一个app_browsers目录来覆盖单个应用程序,并将文件放在那里。 Note that you can also edit these files if the updates don't cover your scenario and you're unable to find a version elsewhere. 请注意,如果更新不能满足您的情况,并且您无法在其他地方找到版本,则也可以编辑这些文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM