.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

OnKeyUp Delay?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :ASP.Net


I have 2 controls inside an update panel.

The first is a single line text box. The other is a listbox control.

I'm trying to come up with a barcode scanning system and have this idea below almost working, with one exception.

Here's what I've got...

When the page loads the focus is set to the textbox.

The user scans a member card and the id is entered into the textbox.

The textbox has a .textchanged event that resolves the scanned id and then lists that member's name in the listbox, but keeps the id as the listbox value.

Here's the problem...

The page utilizes the ClientScriptManager with an "onkeyup" event on the textbox, with an autopostback command. So when the MemberId is scanned, the .textchanged event is called, the name is resolved and shown in the list box. This all seems to work in Firefox but in IE8 the .textchanged event fires so quickly that sometimes the wrong name is resolved as a result of it not taking the entire member id before the event is fired.

I want to create a delay in the onkeyup event so that it waits 500 milliseconds before firing the .textchanged event.

There are some javascript examples on how to create a delay on the web, but I'm not sure how to incorporate this into my .net appliication.

Any ideas?



View Complete Post

More Related Resource Links

Email enabld list delay on recieving emails


So the situation is, i have a list, that receives emails from a particular account all day long, recently it has started recieving emails "late" being it will mass process emails at various times of the day. Before it proccessed them as soon as they were received.

Event log shows

A critical error occurred while processing the incoming e-mail file C:\Inetpub\mailroot\Drop\e472144001cb44a40000001e.eml. The error was: The process cannot access the file 'C:\Inetpub\mailroot\Drop\e472144001cb44a40000001e.eml' because it is being used by another process..


Have this error everywhere.

        -Restarted SMTP

        -Restarted IIS

It seems SMTP is having issues but wanted to come here and get some insight.


-I havent changed anythign recently except new cable runs to the switch

-There is no mail in the (Drop, Mailbox,Pickup, Queue) folders

-mail setup settings are

              -incoming is set to "Advanced" , no,  server.domain.com

Outgoing is my exange server.



Timer delay

Hi guys, Please can one of you help me out. I have a bit of a trouble with the timer, it delay of 10 seconds which it should be of 5 seconds when I started the timer.   here it is the code Public Class Form1 Dim cPos As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cPos = Windows.Forms.Cursor.Position End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Me.Panel1.Show() If Panel1.Visible = True Then Timer1.Interval = 5000 Timer1.Start() Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos Else MessageBox.Show("mouse NOT moved in last 5 secs.") Panel1.Visible = False Timer2.Enabled = True End If End If End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim nPos As Point = Windows.Forms.Cursor.Position If cPos <> nPos Then cPos = nPos If Panel1.Visible = False Then If Me.Panel1.ClientRectangle.Contains(Me.Panel1.PointToClient(Windows.Forms.Cursor.Position)) Then Panel1.Visib

How to delay the close() in client

HI,        I'm writing a WCF using wsDualHttpBinding as binding property, in my client side i specified the closeTimeout as 00:00:00, it throws the timout exception, when i closed the channel, using close() in client side code.   However, if i specify the closeTimeout  as 00:00:01, it will finish the close of channel, within 1 second. But for 0.01, 0.1 second it cannot able to close, now i want to specify a 30 second closeTimeout, and in the code behind i want to make the close to take more time to finish closing the channel. How can i make the close() to wait,   any idea,

Invoke Delay Activity multiple times

HI! I am using Workflow Foundation workflows with sharepoint lists. I have a state machine workflow. One state of workflow has 2 event driven activities, one is waiting for task change and other is waiting for delay of 1 day. What i need is to send email if delay of 1 day is elapsed and send this email every day. But Delay activity is invoked only once. How can i change it so that it can be invoked multiple times. Shabih

Delay in Sequence Problem??????

I have a Approval work flow..What i am doing is,if the approver doesn't review with in a certain time-period the task will be send to another person in the company.... I did this by using Sharepoint List ..and i am using Listen Activity ... Inside the Listen Activity i am using HandleExternalEventActivity and Delayas Parellel Activity... But it does'nt work...I dont know how to extend it... I refers many article...most of them said there is an issue in delay activity...i got conduced ..is that problem fixed or not ? pls guide me... Thanks ________________________ arWINdh

onKeyUp UpperCase

Hi,I have a TextBox and it should accept only UpperCase characters, that uppercase characters should save in DB.Here in the TextBox AutoPostBack is compulsory. I used this JavaScript in my TextBox controlonkeyup="javascript:this.value=this.value.toUpperCase();"but the text change event is not firing. Can anybody give me suggestions regarding this in JavaScript

Forum Subscriptions emails are sent with a delay of 2 hours

Hello I have a couple of forum subscriptions like the ASP.NET MVC forum and I have noticed that when someone creates a new thread that it takes up to 2 hours before I receive the email notification. Can this setting be changed somewhere because I cannot find it in "Edit Profile". Thanks 

How to Show Loading Message while delay in Page Opening

Hy My web application is make time to open First page due to various data control on the page and values are coming to that control from database so i want to show the loading message of gif image during page loading delay. I have written this code in my master page but that image is not showing the application so please give solution on that problem<html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server">   <title>Load Wait Message Demo</title> </head> <script type="text/javascript" language="javascript">   if(document.getElementById) { // IE 5 and up, FF     var upLevel = true;   } else if(document.layers) { // Netscape 4     var ns4 = true;   }   else if(document.all) { //IE 4      var ie4 = true;   }   function showObject(obj) {   if(ns4) {      obj.visibility = "show";   }   else if (ie4 || upLevel) {      drawMessageBox(); obj.style.visibility = "visible";            } }        showObject('splashScreen');   function hideObject(obj) {   if(ns4) {     

Extremely long delay in MapUrlToZoneWrapper called by LateBoundBitmapDecoder.DownloadCallback

After a random interval, our application will appear to lock up when switching to a different view. The profiler indicates that the time is being spent in MS.Internal.SecurityHelper.MapUrlToZoneWrapper (and presumably therefore in the native MapUrlToZone function).  The method takes 1.3s to return; multiply by ~150 images and the total wait time for the user is three minutes (for what is usually an instant operation). My question is - why does this start happening at a random point during the application's lifetime?  For the first half-hour or so, the experience is perfectly normal - you can flip between the two views as much as you like with no ill effect.  Then at a certain point it starts taking minutes to switch - one CPU core is at 100% during the period. Internally, we're using bitmaps with a UriSource pointing to an in-process http server (long story about why this is the case).

onkeyup event for button

hi..i want to impliment the onkeyup event for the button...please help me how i can impliment this...thanks in advance.....

Delay Activity wake up issue..

Hi guys! I've a big problem with my sharepoint 2010: when I use a DelayActivity my workflow NEVER wake up... Sharepoint timer service is ON, and it's loop time is set to 2 minutes. I have already tried with this suggestion (http://howtosharepoint.blogspot.com/2010/05/sharepoint-workflow-delay-activity-not.html), but I still have the problem. Any ideas? Enrico

Unit Testing Delay Activity in workflows 4.0

I need to run unit test scripts for workflows developed in workflows 4.0. I have requirement to unit test the whole workflow including the delay activity.   If the delay activity contains for example for 15 days delay and after that it perform certain other tasks. In this scenario I cannot wait for 15 days for unit test the workflows.   Please let me know How to unit test workflows in case of delay activity? Can I modify the pending timer filed in instance table to advance time?  rajeevkalyan

Problem: Experiencing a delay/timeout in retreiving data

Hi, I have a simple question. We had a application before working perfectly. we moved the application and the WCF into new server. unfortunately we are experiencing some delays/timeout in retreiving data . what do you think it cause?3 stars and a sun

Delay Activity is not working with SharePoint state machine workflow

Hello,   I have a problem with Delay Activity in Sharepoint state machine workflow. This issue is kind of common to many people but so far I haven't come accross any working solution. In one of the workflow states, I want to add a delay activity to send email notification if no action is taken after certain time. Below is what I have done:   In the targeted state: 1) add one eventDriven activity to handle the normal process (approve the item) 2) add another eventDriven activity to send the reminder email. In this eventDriven activity, I first add a delayActivity, set it to 2 minutes for test purpose. Then I add a Sharepoint SentEmail activity.   With my test, the Dealy Activity is never invoked after timeout period. What should I do to make the delay activity work in the SharePoint state machine workflow? Is there any work around if the delay activity is simply not working there?   Any suggestions are appreciated.

Problem with bookmarks when combined with Delay activity.

Let's take this code sample : using System; using System.Activities; using System.Activities.DurableInstancing; using System.Activities.Statements; using System.Collections.Generic; using System.Runtime.DurableInstancing; using System.Threading; using System.Xml.Linq; using Microsoft.VisualBasic.Activities; namespace WindowsFormsApplication1 { public class WaitExternalEventActivityTestInnerCode : CodeActivity { public OutArgument<string> resultat { get; set; } protected override void Execute (CodeActivityContext context) { context.SetValue (resultat, "SUCCEEDED"); } } public class WaitExternalEventTestEvent : NativeActivity { protected override void Execute (NativeActivityContext context) { context.CreateBookmark ("TestEvent"); } protected override bool CanInduceIdle { get { return true; } } } internal static class Program { private static SqlWorkflowInstanceStore _store; private static readonly XName WorkflowHostTypePropertyName = XNamespace.Get ("urn:schemas-microsoft-com:System.Activities/4.0/properties").GetName ("WorkflowHostType"); private static readonly XName WfHostTypeName = XName.Get ("V1", "Test"); [STAThread] static void Main () { // Init the persistance store string connectionString = @"Data Source=.\

Ajax issue: delay in getting data from web service using innerHTML, please guide

I am working on an ajax application which will display about a million records in an html table. Web service returns records from server, I build a logn string by concatinating data and tags and than put this string using innerHTML (not using DOM for getting better performance). For testing I have put 6000 recods in database (stored procedure takes about 4 seconds in completion of its execution). While testing on local system (database and application on same machine) it took about 5 minutes to display the records in page. After deplying on web server it did not responde even for more time. It looks very low performance. I put records in a CSV file and its weight was less than 2 MB. I couldn't understand why string concatinations to build html table and putting string in innerHTML is taking such a huge time (if it is the issue). Requiment is to show about million records in web page but performance on just 6000 records is disappointing. I am not gettign what to do to increase performance. Kindly guide me and help me.  

Delay Postback in Javascript


How to Delay Postback in Asp.net Using Javascript: Please Post Some Sample Code

I have a Button Need to Show a Timer Of 10 Seconds and Then Postback. This will happen on Button CLick

So How can i Accomplished that ??

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend