Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Use textbox to filter a DropDownList

Reply
Thread Tools

Use textbox to filter a DropDownList

 
 
Rob
Guest
Posts: n/a
 
      03-20-2007
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



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Rob
Guest
Posts: n/a
 
      03-20-2007
Error in my previous post.
I am using the onKeyUp event to trigger the filtering of the dropdown
list...no the onchange event.

Rob



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Rob
Guest
Posts: n/a
 
      03-20-2007
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



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie question - Use dropdownlist or textbox for db insert? benjamin.derr@css-security.com ASP .Net 4 05-30-2007 04:59 PM
Use dropdownlist as textbox Li Pang ASP .Net Web Controls 3 08-10-2006 05:22 PM
GridView: Filter DropDownList for another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-29-2005 07:44 AM
to filter of not to filter Ken Digital Photography 2 12-23-2005 12:45 PM
UV Protector filter vs. Skylight filter? john Digital Photography 8 06-26-2004 03:44 PM



Advertisments