下拉列表选择值错误 [英] Drop down list selected value error

查看:69
本文介绍了下拉列表选择值错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新面板中有一个下拉列表但是当我为ddl.selectedValue分配任何值时,它没有选择该值



例如。



I have one drop down list in update panel but when I assign any value to ddl.selectedValue it is not selecting that value

for eg.

ddl.selectedValue=2





然后它仍然是空的



i使用断点检查它并没有变为2.



请帮帮我......



then it remains null

i had check it using break point it is not changing to 2.

please help me......

推荐答案

hay jagdish,



更改下拉列表属性AutoPostBack:True

它的工作..
hay jagdish,

Change your dropdownlist properties AutoPostBack : True
its work..


我认为你可以在设计页面中给出属性。< br $>


I think you can give the property in design page itself.

<asp:DropDownList ID="DropDownListname" runat="server">
                    <asp:ListItem Value="0">first value</asp:ListItem>
                    <asp:ListItem Value="2">second value</asp:ListItem>
                    <asp:ListItem Value="3">third value</asp:ListItem>
                </asp:DropDownList>







或者尝试



dropdownlist.selecteditem ='那个字符串'




Or try

dropdownlist.selecteditem='That String'


我发现它是数据绑定错误。数据未绑定到ddl,因此所选值为空。





thanx to u all for reply ...
I found that it was databinding error. data was not bound to ddl therefore selected value was empty.


thanx to u all for reply...


这篇关于下拉列表选择值错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆