如何检查下拉菜单是否选中 [英] how to check the drop down is select or not

查看:67
本文介绍了如何检查下拉菜单是否选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要检查下拉列表是否被选中.如果选择它,我需要调用该函数.我尝试使用此代码.

if(dropdownlist1.selectitem!= null)
{
函数调用;
}

但这不起作用...
谁能帮我..
谢谢..

Hi,
i need to check whether the drop down list is select or not. if its selected i need to call the function. i tried with this code.

if(dropdownlist1.selectitem!=null)
{
function call;
}

but this is not working...
can anyone help me..
thanks..

推荐答案

捕获SelectedItem事件,然后通过代码处理该事件.
Capture the SelectedItem event and then handle that event via code.


if (price_drop.SelectedIndex.ToString() != "0")

          {

              uploadprice(price_drop, price_txt, ids);
          }


这篇关于如何检查下拉菜单是否选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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