关于下拉列表? [英] about drop downlist ?

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

问题描述

任何One告诉哪个事件在下拉列表项目上选择并改变表单控制意味着例如。当选择ddlist中的一个项目时,表单中的一个控件可见true或false ...

Can any One Tell which event ocur when selecting on dropdownlist item and changing form control means eg. when selecting one of the item in ddlist then one of the control in form is visible true or false...

推荐答案

这是ListControl.SelectedIndexChanged [ ^ ] event。
It's the ListControl.SelectedIndexChanged[^] event.


<asp:DropDownList ID="ddl" runat="server"  onselectedindexchanged="ddl_SelectedIndexChanged" AutoPostBack="true">
       </asp:DropDownList>







protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
   {
    if(ddl.SelectedItem.Text="Yes")
      {
        txt_box1.Visible=true;
      }
   }







注意:-Autopostback = 真实是强制性的,



转到你的表单设计视图双击它,你得到代码背后的选定索引更改代码块




Note:-Autopostback="true" is compulsary,

Go to design view of ur form double click on it,you get the selected index changes code block in code behind


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

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