need to add a 2nd dropdown search c# ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pearsont74
    New Member
    • Mar 2008
    • 1

    need to add a 2nd dropdown search c# ASP.NET

    ok...i have an existing html form that have a number of fields..one being a dropdown specialty list.
    the form does a get to an aspx datagrid written in c# (i did not write this and i need to only modify it until i have time to redo the entire thing so please dont say its all wrong, i know lol)

    the filter for the specialty is a loop statement using if...
    Code:
    if (Server.HtmlEncode(arr1[loop1])=="specialty")
    							sWhere += "specialty  LIKE '%" + (arr2[loop2])+ "%' AND ";
    							
    						if (Server.HtmlEncode(arr1[loop1])=="specialty2")
    							sWhere += "specialty  LIKE '%" + (arr2[loop2])+ "%' AND ";
    the dropdown id's are specialty and specialty2
    basically i need to change it so that if specialty2 is selected it will filter by both
    wha ti have above works but if both are selected....ins tead of filtering by both..i get no results.
    Last edited by jhardman; Mar 18 '08, 09:06 PM. Reason: moved to .Net forum. ASP forum is for "classic" ASP
Working...