Use textbox to filter a DropDownList

R

Rob

Hi,
I'm trying to duplicate a page from Classic ASP to ASP.Net 1.1.
In Classic ASP, I have a <select> box populated by a recordset that
holds a list of parts and I have a textbox and when I enter a part
number in this text box...I have a javascript onchange event that calls
a javascript function that selects the proper part from the select box
as you type.

My question is how is this done in .Net 1.1. I have a textbox and a
DropDownList (which is populated by a DataReader) and I thought I would
use the "OnTextChanged" event and filter the dropdownlist however this
requires a postback.

I'm using Visual Studio 2003 so I don't have access to AJAX.
Does anyone know where I can find a tutorial on how to do this?
I need to filter the correct part as I type each keystroke.

Thanks
Rob
 
R

Rob

Error in my previous post.
I am using the onKeyUp event to trigger the filtering of the dropdown
list...no the onchange event.

Rob
 
R

Rob

Found the Answer!
In case anyone else wants to know...

I kept the same Javascript function and added it to my .Net App and
added this next line of code in my Page_Load Sub.

txtSearch.Attributes.Add("onkeyup", "lookupECC(document.Form1.txtSearch,
document.Form1.ddlSearchResults);")

Fixed!
I guess it has to be done in Javascript as .Net doesn't support an
onKeyUp event for the textbox.



Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top