Click here to Skip to main content
15,904,287 members
Home / Discussions / C#
   

C#

 
GeneralRe: Bumping an old post - https web request Pin
Mike Devenney3-Jun-09 7:34
Mike Devenney3-Jun-09 7:34 
GeneralRe: Bumping an old post - https web request Pin
Nicholas Butler3-Jun-09 11:32
sitebuilderNicholas Butler3-Jun-09 11:32 
GeneralRe: Bumping an old post - https web request Pin
Mike Devenney4-Jun-09 2:33
Mike Devenney4-Jun-09 2:33 
GeneralRe: Bumping an old post - https web request Pin
Mike Devenney4-Jun-09 7:32
Mike Devenney4-Jun-09 7:32 
QuestionCreate buttons dinamyclly Pin
geniaz129-May-09 5:03
geniaz129-May-09 5:03 
GeneralRe: Create buttons dinamyclly Pin
musefan29-May-09 5:08
musefan29-May-09 5:08 
AnswerRe: Create buttons dinamyclly Pin
EliottA29-May-09 5:20
EliottA29-May-09 5:20 
GeneralRe: Create buttons dinamyclly Pin
geniaz129-May-09 5:51
geniaz129-May-09 5:51 
GeneralRe: Create buttons dinamyclly Pin
Douglas Kirk29-May-09 7:08
Douglas Kirk29-May-09 7:08 
GeneralRe: Create buttons dinamyclly Pin
Moreno Airoldi29-May-09 7:15
Moreno Airoldi29-May-09 7:15 
AnswerRe: Create buttons dinamyclly Pin
Luc Pattyn29-May-09 8:36
sitebuilderLuc Pattyn29-May-09 8:36 
QuestionUserControl Docking and padding question Pin
EliottA29-May-09 5:02
EliottA29-May-09 5:02 
AnswerRe: UserControl Docking and padding question Pin
musefan29-May-09 5:23
musefan29-May-09 5:23 
GeneralRe: UserControl Docking and padding question Pin
EliottA29-May-09 6:10
EliottA29-May-09 6:10 
GeneralRe: UserControl Docking and padding question Pin
musefan29-May-09 6:21
musefan29-May-09 6:21 
GeneralRe: UserControl Docking and padding question Pin
EliottA29-May-09 6:32
EliottA29-May-09 6:32 
Questiondesign pattern needed (for C#) Pin
NaNg1524129-May-09 4:54
NaNg1524129-May-09 4:54 
AnswerRe: design pattern needed (for C#) Pin
Ennis Ray Lynch, Jr.29-May-09 4:58
Ennis Ray Lynch, Jr.29-May-09 4:58 
GeneralRe: design pattern needed (for C#) Pin
NaNg1524129-May-09 5:14
NaNg1524129-May-09 5:14 
GeneralRe: design pattern needed (for C#) Pin
EliottA29-May-09 5:53
EliottA29-May-09 5:53 
GeneralRe: design pattern needed (for C#) Pin
NaNg1524129-May-09 11:05
NaNg1524129-May-09 11:05 
AnswerRe: design pattern needed (for C#) Pin
DaveyM6929-May-09 6:20
professionalDaveyM6929-May-09 6:20 
QuestionThrottle user input Pin
edlanka29-May-09 3:30
edlanka29-May-09 3:30 
AnswerRe: Throttle user input Pin
Ennis Ray Lynch, Jr.29-May-09 3:44
Ennis Ray Lynch, Jr.29-May-09 3:44 
AnswerRe: Throttle user input Pin
Luc Pattyn29-May-09 3:53
sitebuilderLuc Pattyn29-May-09 3:53 
Hi,

you need a single timer for that; it will be used as a one-shot with 2 second interval.

1.
When the user enters something, start the timer (if not already running) and set its interval to 2000 msec. Don't call the server yet.
When the interval elapses, call the server and stop the timer (prevent it from firing periodically).

With this set-up you are getting something resembling a user-idle detector, with the disadvantage that a user typing 1 character a second won't get anything until he stops typing for at least 2 seconds.

2.
If you want intermediate server calls as well, on top of tbe above, note the DateTime.Now value of every user action and compare them with the time of the last server call.

3.
If you want no delay on first input, on top of the above, check for timer running; if not, call server.


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.