Html.DropDownListFor 的 IE9 错误
您好,我需要一些有关 Internet Explorer 9 中错误的帮助。我目前正在 ASP.NET 4 MVC 3 Razor 中开发一些 CRUD 屏幕。在多屏幕中,我使用 @Html.DropDowListFor 为外键创建简单链接。
但是,当我在 IE9(并且仅 IE9)中使用这些时,DropDownList 将呈现为小于其通常的大小,文本将显示为比正常情况低几个像素,并且如果显示的单词大于少量字符(不确定是什么数字,我认为大约是 10 个)它将无法完全渲染。奇怪的是,当我单击 DropDownList 时,它会自行修复。
视图代码:
@Html.DropDownListFor(model => model.Asset.FkAssetTypeId, new SelectList(Model.AssetTypes, "AssetTypeId", "Name"))
@Html.ValidationMessageFor(model => model.Asset.FkAssetTypeId)
模型代码:
[Display(ResourceType = typeof(I18N_Asset), Name = "Label_Asset_FkAssetTypeId")]
public int FkAssetTypeId { get; set; }
有人对这个问题有任何经验,并且知道解决这个问题的方法吗?谢谢你的帮助。
Hello I need some help with a bug in Internet Explorer 9. I am currently developing some CRUD screens in ASP.NET 4 MVC 3 Razor. In a multiple screen I use the @Html.DropDowListFor to create easy links for Foreign keys.
But when I few these in IE9 (and only IE9) the DropDownList will be rendered smaller than its usual size, the text will be displayed a few pixels lower than normal, and the if the word that is displayed is larger than a small amount of characters(not sure what number, I think it's about 10) it will not be fully rendered. The weird part is that when I click on the DropDownList it will fix itself.
The View code:
@Html.DropDownListFor(model => model.Asset.FkAssetTypeId, new SelectList(Model.AssetTypes, "AssetTypeId", "Name"))
@Html.ValidationMessageFor(model => model.Asset.FkAssetTypeId)
The Model code:
[Display(ResourceType = typeof(I18N_Asset), Name = "Label_Asset_FkAssetTypeId")]
public int FkAssetTypeId { get; set; }
Anybody have any experience with this issue, and know a way to fix this? thank you for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现问题是什么,我在同一页面上使用 JQuery 选项卡。这导致 dropdownlistfor-s 的 frontsize 无法缩放到为整个站点设置的 css。而是使用 JQuery 选项卡的 frontsize 呈现下拉框,然后将 frontsize 设置为 css。
我通过使用 Javascript 在 Document.ready 函数中设置字体大小解决了这个问题:
I have found what the problem was, I was using JQuery tabs on the same page. This caused the frontsize of the dropdownlistfor-s to not scale to the css that is set for the whole site. but instead renders the dropdownboxfor with the frontsize of the JQuery tabs and than sets the frontsize to the css.
I have solved this issue by using Javascript to set the font-size in a Document.ready function: