如何从 ASP.net 中的 ASPxComboBox 获取字符串值
我试图从 aa DropDownList
中提取选定的值作为 string
,如下所示:
if ((ASPxComboBox1.SelectedItem.Value).ToString = "Selection")
这不起作用。请告诉我是否有办法提取每个选定的字符串?
I'm trying to extract the selected value from a a DropDownList
as a string
as follows:
if ((ASPxComboBox1.SelectedItem.Value).ToString = "Selection")
This is not working. Please let me know if there is a away of getting each selected string extracted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的语法似乎很奇怪,但请尝试(我假设是 c#,因为您没有指定您使用的语言):
在您的代码中,您正在执行分配并将文本“Selection”分配给
ToString
,这应该是'甚至无法编译。另外,您将其命名为组合框,但 ASP.NET 没有组合框,只有下拉列表...
Your syntax seems odd but try (I am assuming c# because you didn't specify the language your using):
In your code you are doing an assignment and assigning the text "Selection" to
ToString
which shouldn't even compile.Also you named it a combobox but ASP.NET does not have a combobox just a dropdownlist...