简体   繁体   English

在ASP.NET AJAX ComboBox中击退空格会导致JavaScript错误

[英]Hitting backspace in ASP.NET AJAX ComboBox causes JavaScript error

I am using a ComboBox from the ASP.NET AJAX Toolkit (version for .NET 3.5) with values populated into its DataSource property. 我正在使用ASP.NET AJAX工具包(.NET 3.5的版本)中的ComboBox,并将值填充到其DataSource属性中。

If I use my mouse to drop the combobox down and select a value, then highlight the value and click backspace, I get an error: 如果我使用鼠标下拉组合框并选择一个值,然后突出显示该值并单击退格键,则会收到错误消息:

Microsoft JScript runtime error: '_optionListItems[...].text' is null or not an object

My DropDownStyle is set to "DropDown" so I should be able to have text in the control that does not exactly match one of the items in it. 我的DropDownStyle设置为“ DropDown”,因此我应该能够在控件中找到与其中一项完全不匹配的文本。 Therefore, I do not understand why I get this error. 因此,我不明白为什么会出现此错误。 It seems to work perfectly otherwise. 否则,它似乎可以完美地工作。

Per this forum post I had to edit the source code of the AJAX Control Toolkit. 此论坛帖子中,我必须编辑AJAX Control Toolkit的源代码。 Once I added this additional condition, it all worked. 一旦添加了此附加条件,它便可以正常工作。

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

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