Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 35423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:14:01+00:00 2026-05-10T14:14:01+00:00

I have an extender control that raises a textbox’s OnTextChanged event 500ms after the

  • 0

I have an extender control that raises a textbox’s OnTextChanged event 500ms after the user has finished typing. The problem with this is that OnTextChanged gets raised when the textbox loses focus, which causes problems (because of the postback).

What I’d like to do is give the extender control its own server-side event (say, OnDelayedSubmit) so I can handle it separately. The event will originate in the extender control’s behavior script (after the 500ms delay), so putting a __doPostBack in onchanged is not an option.

Can anyone shed light on how to go about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:14:01+00:00Added an answer on May 10, 2026 at 2:14 pm

    After plenty of reading up on extender controls and JavaScript, I’ve cobbled together a solution that seems to be working so far.

    The main trick was getting the necessary postback code from server-side to the client-side behavior script. I did this by using an ExtenderControlProperty (which is set in the control’s OnPreRender function), and then eval’d in the behavior script. The rest was basic event-handling stuff.

    So now my extender control’s .cs file looks something like this:

    public class DelayedSubmitExtender : ExtenderControlBase, IPostBackEventHandler {     // This is where we'll give the behavior script the necessary code for the      // postback event     protected override void OnPreRender(EventArgs e)     {         string postback = Page.ClientScript.GetPostBackEventReference(this, 'DelayedSubmit') + ';';         PostBackEvent = postback;     }      // This property matches up with a pair of get & set functions in the behavior script     [ExtenderControlProperty]     public string PostBackEvent     {         get         {             return GetPropertyValue<string>('PostBackEvent', '');         }         set         {             SetPropertyValue<string>('PostBackEvent', value);         }     }      // The event handling stuff     public event EventHandler Submit;  // Our event      protected void OnSubmit(EventArgs e)  // Called to raise the event     {         if (Submit != null)         {             Submit(this, e);         }     }      public void RaisePostBackEvent(string eventArgument)  // From IPostBackEventHandler     {         if (eventArgument == 'DelayedSubmit')         {             OnSubmit(new EventArgs());         }     }  } 

    And my behavior script looks something like this:

    DelayedSubmitBehavior = function(element) {     DelayedSubmitBehavior.initializeBase(this, [element]);      this._postBackEvent = null; // Stores the script required for the postback }  DelayedSubmitBehavior.prototype = {     // Delayed submit code removed for brevity, but normally this would be where      // initialize, dispose, and client-side event handlers would go      // This is the client-side part of the PostBackEvent property     get_PostBackEvent: function() {         return this._postBackEvent;     },     set_PostBackEvent: function(value) {         this._postBackEvent = value;     }      // This is the client-side event handler where the postback is initiated from     _onTimerTick: function(sender, eventArgs) {         // The following line evaluates the string var as javascript,         // which will cause the desired postback         eval(this._postBackEvent);     } } 

    Now the server-side event can be handled the same way you’d handle an event on any other control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple extender component that draws 3D borders around any Control. In
I have a modal popup extender tied to a asp:panel control that I want
I have an ASP.NET web application that has a fileupload control to allow users
I have an Panel control that I need to maintain position across postbacks. I
I'm attempting to write an AJAX control extender that can modify an AJAX Control
I have a DropDownList and a TextBox on a Page. When the user chooses
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I have a C++ Windows application that can be extended by writing C++ plugins,
Is there a way to write an enumeration that can be extended. I have
I have a Yes linkbutton that trigger a popup (ModalPopUpExtender) The popup contain a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.