I've got a list control on my ASP page that draws it recordset from a stored procedure in SQl Server database. I want to look at the value in one of the recordset fields and compare it against each value in the list box. If the two are equal, I want to set the list control so that the value is selected, but still show the rest of the recordset.
Here's my code
I get the entire recordset to load in the list, but the select doesn't.
Any thoughts?
Here's my code
Code:
<select name="cmbponds">
<%
While (NOT rsponds.EOF)
response.write("<option ")
varPond = rseditfeed.Fields.Item("pond").Value
if cstr(cmbponds) = varPond then response.write("selected ") end if
response.write("value=""" & varPond & """>" & rsponds.Fields.Item("pond").Value & "</option>")
rsponds.MoveNext()
Wend
I get the entire recordset to load in the list, but the select doesn't.
Any thoughts?