G
Guest
Hello All,
I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton
(SearchButton) server controls. The user can type search text in
SearchTextBox and click SearchButton and the web server performs a database
query and displays the results. All of this works fine.
I want the user to be able to press the Enter key while the cursor is still
in SearchTextBox and have the SearchButton.Click event fire (thus performing
the database query and displaying the results). I have
SearchTextBox.AutoPostBack = False because I don't want the page to repost
everytime the user types something; I just want it to query the database adn
display teh results when the user presses the Enter key.
I've thought about using AddHandler SearchTextBox.TextChanged, AddressOf
HandleEnterKey
using the private sub
Private Sub HandleEnterKey()
If EnterKeyPressed Then
SearchButton_Click(SearchtextBox, e)
End If
End Sub
but I don't know what EventArgs to pass in for the parameter, e.
Does anyone know how to make this happen? Does anyone have any other ideas?
TIA,
I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton
(SearchButton) server controls. The user can type search text in
SearchTextBox and click SearchButton and the web server performs a database
query and displays the results. All of this works fine.
I want the user to be able to press the Enter key while the cursor is still
in SearchTextBox and have the SearchButton.Click event fire (thus performing
the database query and displaying the results). I have
SearchTextBox.AutoPostBack = False because I don't want the page to repost
everytime the user types something; I just want it to query the database adn
display teh results when the user presses the Enter key.
I've thought about using AddHandler SearchTextBox.TextChanged, AddressOf
HandleEnterKey
using the private sub
Private Sub HandleEnterKey()
If EnterKeyPressed Then
SearchButton_Click(SearchtextBox, e)
End If
End Sub
but I don't know what EventArgs to pass in for the parameter, e.
Does anyone know how to make this happen? Does anyone have any other ideas?
TIA,