组合框启用禁用问题 [英] Combobox Enable Disable problem

查看:79
本文介绍了组合框启用禁用问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在一个
我有一个下拉菜单,其中
下拉菜单选择的更改甚至
正在检查

 如果(ddl.selctedindex> 0)
{
    功能();
}
其他
{
    function2();
}
功能()
{
    combobox1.enable =  false ;
}

function2()
{
    combobox1.enable =  true ;
} 



但是如果要进行2到3次相同的操作就无法正常工作

解决方案

下拉列表中没有像''enable''这样的属性代码combobox1.enable.应该改为启用


应用以下内容:
设置

AutoPostBack="True"


 受保护的  void  ddl_SelectedIndexChanged(对象发​​件人,EventArgs e)
    {
        如果(ddl.SelectedIndex >   0  )
        {
            功能();
        }
        其他
        {
            function2();
        }
    } 



 受保护的  void  function()
{
    ddl.Enabled =  false ;
}
受保护的 无效 function2()
{
    ddl.Enabled =  true ;
} 


希望以上信息对您有所帮助.如果您还有其他疑问,请告诉我.


您的问题不是很清楚,但是请尝试以下操作:

 如果(ddl.selctedindex> 0)
{
   combobox1.enable =  false ;
}
其他
{
   combobox1.enable =  true ;
} 



如果仍然遇到问题,请在IE中启用Javascript调试,然后在此方法的开头放置"debugger;".看看执行是如何进行的,以及是否有意外情况.


hi
in one
i have one dropdown in which
dropdown selected change even
am checking like

if(ddl.selctedindex>0)
{
    function();
}
else
{
    function2();
}
function()
{
    combobox1.enable=false;
}

function2()
{
    combobox1.enable=true;
}



but it not working if am doing same operation 2 to 3 time its working

解决方案

The drop down list don''t have a property like ''enable'' as in your code combobox1.enable. It should be Enabled instead


Apply the followings:
Set

AutoPostBack="True"


protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddl.SelectedIndex > 0)
        {
            function();
        }
        else
        {
            function2();
        }
    }



protected void function()
{
    ddl.Enabled = false;
}
protected void function2()
{
    ddl.Enabled = true;
}


I hope the above information will be helpful. If you have more concerns, please let me know.


Your question is not very much clear, but try this:

if(ddl.selctedindex>0)
{    
   combobox1.enable=false;
}
else
{    
   combobox1.enable=true;
}



In case you still face issue, then enable Javascript debugging in your IE and then put "debugger;" at the start of this method. See how the execution is happening and if something is unexpected.


这篇关于组合框启用禁用问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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