473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SearchBox_TextChanged

I am building a asp.net 1.1 phone directory that I want to search names as
soon as a user inputs values to a textbox called "SearchBox".

Example: I enter an “r” all names start showing, then “o” and all “ro” names
and so forth. I am assuming the best way to accomplish this is by populating
a dataset and search from the dataset.

Unfortunately this is not happening and will only search when enter is
pressed.

Any suggestions or recommendations?

Nov 19 '05 #1
3 991
That is a server side event. So until the user does something to make the
page post back to the server, the event won't run.

If you need it to post immediatelly, you will need client side javascript
code to initiate a postback.

Please remember that this is all happening in a completely disconnected
environment. There is a client side part and a server side part. It all
works quite differently from windows forms.

"Moojjoo" <Mo*****@discussions.microsoft.com> wrote in message
news:19**********************************@microsof t.com...
I am building a asp.net 1.1 phone directory that I want to search names as
soon as a user inputs values to a textbox called "SearchBox".

Example: I enter an "r" all names start showing, then "o" and all "ro" names and so forth. I am assuming the best way to accomplish this is by populating a dataset and search from the dataset.

Unfortunately this is not happening and will only search when enter is
pressed.

Any suggestions or recommendations?

Nov 19 '05 #2
If you have wired to the TextChanged event you can add a function to the
text box that will postback on every key up.

txtSearchBox.Attributes.Add( "onkeyup", "javascript:
document.forms[0].submit();");

This will cause a postback everytime a key is lifted from the keyboard.
However, I don't think this is what you are looking for as it will postback
every time they enter a key. If they enter "ro", it would take the r.
Postback and do its thing then show the ro on the screen, then postback
again before the first processing is done. Just beaware of the behavior of
it during testing.

bill

"Moojjoo" <Mo*****@discussions.microsoft.com> wrote in message
news:19**********************************@microsof t.com...
I am building a asp.net 1.1 phone directory that I want to search names as
soon as a user inputs values to a textbox called "SearchBox".

Example: I enter an "r" all names start showing, then "o" and all "ro" names and so forth. I am assuming the best way to accomplish this is by populating a dataset and search from the dataset.

Unfortunately this is not happening and will only search when enter is
pressed.

Any suggestions or recommendations?

Nov 19 '05 #3
I believe this will be a pretty neat Web App once I get it to work.
Basically this is for an Intranet, which is using SQL server that runs a job
to popolate a database of all employees from a DB2 database.

I saw a VB app that worked like this, and want the ASP.NET app to act the
same.

"William F. Robertson, Jr." wrote:
If you have wired to the TextChanged event you can add a function to the
text box that will postback on every key up.

txtSearchBox.Attributes.Add( "onkeyup", "javascript:
document.forms[0].submit();");

This will cause a postback everytime a key is lifted from the keyboard.
However, I don't think this is what you are looking for as it will postback
every time they enter a key. If they enter "ro", it would take the r.
Postback and do its thing then show the ro on the screen, then postback
again before the first processing is done. Just beaware of the behavior of
it during testing.

bill

"Moojjoo" <Mo*****@discussions.microsoft.com> wrote in message
news:19**********************************@microsof t.com...
I am building a asp.net 1.1 phone directory that I want to search names as
soon as a user inputs values to a textbox called "SearchBox".

Example: I enter an "r" all names start showing, then "o" and all "ro"

names
and so forth. I am assuming the best way to accomplish this is by

populating
a dataset and search from the dataset.

Unfortunately this is not happening and will only search when enter is
pressed.

Any suggestions or recommendations?


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.