当前位置:编程学习 > C#/ASP.NET >>

“求助:dropdownlist控件查询问题”

    protected void Button6_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedItem.Text.Trim() == "姓名")
        {
            string name = TextBox1.Text;
            DataList1.DataSource = me.getallmembersbyname(name);
            DataList1.DataBind();
            TextBox1.Text = " ";
        }
        if (DropDownList1.SelectedItem.Text.Trim() == "身份证号")
        {
            string id = TextBox1.Text;
            DataList1.DataSource = me.getallmembers(id);
            DataList1.DataBind();
            TextBox1.Text = " ";
         }
    }
为什么只能执行一次查询?查了姓名的身份证号的就查不来 DropDownList 控件 --------------------编程问答-------------------- 调试 查看DropDownList1.SelectedItem.Text.Trim() 的属性值
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,