i have a confusion
please help me with the reason
in my ASP.NET web page i have two drop down list
DropDownLis1 is unbound and DropDownList2 is data bound to my table named Employee
so in these two DDLs DropDownList1 works fine
but the DropDownList2 never returns true when it compares against Femina please help me with the reason behind this
sorry for the lengthy question and thanks in advance
please help me with the reason
in my ASP.NET web page i have two drop down list
DropDownLis1 is unbound and DropDownList2 is data bound to my table named Employee
Code:
//unbound (items are Apples,Oranges,Grapes,Fruits) string s="",str=""; foreach (ListItem li in DropDownList1.Items) { bool b = li.Text.Equals("Apples"); //true for Apples str += b; //true for Apples if (b) //li.Text.Equals("Apples")) { s += " the Selection is " + li.Text+" "; } s += li.Text; } Label1.Text = s +" str "+str;
Code:
//bound ( Employee table has employee names //Femina,ramya,jyothi,Nilafer,Fayaz) string ss = ""; foreach (ListItem li in DropDownList2.Items) { bool b = li.Text.Equals("Femina"); //here its never true but dont know why if (li.Text.Equals("Femina")) //not executed at all { ss += " selection is " + li.Text +" "; } ss += li.Text; } Label4.Text += ss;
but the DropDownList2 never returns true when it compares against Femina please help me with the reason behind this
sorry for the lengthy question and thanks in advance
Comment