cgibbons123
asked on
Quickest method for populating a Listbox in ASP
I am building a reporting tool. Each report can be filtered by a postcode or multiple postcodes.
I am successfully populating a multiselect listbox in asp with over 2500 postcodes using the following code
<SELECT MULTIPLE id="lstPostcode" name="lstPostcode" value="lstPostcode" size=2 onclick="DeSelectPostcodeC hkbox()" style="HEIGHT: 70px; WIDTH: 80px">
<%
Do while not rsPostcode.eof
Response.Write "<Option Selected Value='" & Trim(rsPostcode("Postcode" )) & "'>" & Trim(rsPostcode("Postcode" )) & "</Option>" & vbcrlf
rsPostcode.MoveNext
loop
rspostcode.close
%>
</SELECT>
However it is very slow in the live environment. Is there a quicker way to code this or can someone offer a alternative solution?
I am successfully populating a multiselect listbox in asp with over 2500 postcodes using the following code
<SELECT MULTIPLE id="lstPostcode" name="lstPostcode" value="lstPostcode" size=2 onclick="DeSelectPostcodeC
<%
Do while not rsPostcode.eof
Response.Write "<Option Selected Value='" & Trim(rsPostcode("Postcode"
rsPostcode.MoveNext
loop
rspostcode.close
%>
</SELECT>
However it is very slow in the live environment. Is there a quicker way to code this or can someone offer a alternative solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.