i have a if string that fills a datagrid column and i need to add a 2nd part to this.
atm ppl can use a dropdown to search for specialty. i need to add a 2nd dropdown with the same specialtylist and allow ppl to search against both
here is the code if sting for the 1st speciality :
[code]
if (Server.HtmlEncode(arr1[loop1])=="specialty") sWhere += "specialty LIKE '%" + (arr2[loop2]) + "%' AND ";[/code]
the column name is specialty and the dropdown is labled specialty. i added a 2nd dropdown labled specialty2...i want it to work so that if they select one from specialty and specialty2 if will filter on both selections.
how can i incorpate this into this if string?
Tom PearsonPosted Mar 14, 2008, 10:00 AM
i need something like this but my syntaxs is bad i know...can anyone help
if (Server.HtmlEncode(arr1[loop1])=="specialty1")
{
if ((Server.HtmlEncode(arr1[loop1])=="specialty2")
sWhere += "specialty LIKE '%" + (arr2[loop2])+ "%' AND ";)
(Server.HtmlEncode(arr1[loop1])=="specialty1")
sWhere += "specialty LIKE '%" + (arr2[loop2]) + "%' AND ";
}else
if (Server.HtmlEncode(arr1[loop1])=="specialty1")
sWhere += "specialty LIKE '%" + (arr2[loop2])+ "%' AND ";
}
}