G
Grant Merwitz
Hi
I am trying to implement the Microsoft Ajax.NET extensions to perform a
lookup on a key press of a text box.
What this will do is once a user enters a letter into the textbox,
this will filter a list from a database and populate some filtered options
for the user to choose in a seperate listbox.
Any subsequent key presses will further filter this result set.
Now utilising the OnTextChanged property of the textbox, this works
perfectly.
Except you have to tab out of the textbox to trigger the event.
So to make the on key press event work, in my Page_Load i added the
onkeypress attribute to the textbox and specified this to trigger the text
changed event.
tbSearchTerm.Attributes.Add("onkeypress",
Page.ClientScript.GetPostBackEventReference(tbSearchTerm, ""));
Now this kind of seems to work, but has a one character delay.
Example:
action: I enter the character "A" into the textbox.
result: Nothing happens
action: I enter an additional character "B" into the textbox
result: Results for the letter "A" are now returned
action: I enter my third character "C" into the textbox
result: Results for a search for letters "AB" are now returned.
This is causing a most undesirable effect.
How is one supposed to utilise an OnKeyPress action in the AJAX.Net
framework?
This was downloaded from:
http://ajax.asp.net/
And i have been unable to find another solution to this problem.
Any advice would be greatly appreciated
TIA
I am trying to implement the Microsoft Ajax.NET extensions to perform a
lookup on a key press of a text box.
What this will do is once a user enters a letter into the textbox,
this will filter a list from a database and populate some filtered options
for the user to choose in a seperate listbox.
Any subsequent key presses will further filter this result set.
Now utilising the OnTextChanged property of the textbox, this works
perfectly.
Except you have to tab out of the textbox to trigger the event.
So to make the on key press event work, in my Page_Load i added the
onkeypress attribute to the textbox and specified this to trigger the text
changed event.
tbSearchTerm.Attributes.Add("onkeypress",
Page.ClientScript.GetPostBackEventReference(tbSearchTerm, ""));
Now this kind of seems to work, but has a one character delay.
Example:
action: I enter the character "A" into the textbox.
result: Nothing happens
action: I enter an additional character "B" into the textbox
result: Results for the letter "A" are now returned
action: I enter my third character "C" into the textbox
result: Results for a search for letters "AB" are now returned.
This is causing a most undesirable effect.
How is one supposed to utilise an OnKeyPress action in the AJAX.Net
framework?
This was downloaded from:
http://ajax.asp.net/
And i have been unable to find another solution to this problem.
Any advice would be greatly appreciated
TIA