OnTextChanged event not firing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobertTheProgrammer
    New Member
    • Aug 2007
    • 58

    OnTextChanged event not firing

    Help!

    I have an ASP textbox where the OnTextChanged event is not firing. Here's the call:

    <asp:TextBox ID="ApproverCop y" runat="server" CssClass="noSho w" OnTextChanged=" StoreNewTrainin gs" AutoPostBack="T rue"></asp:TextBox></TD>

    The event fires if I enter the value manually, but not when I do it programmaticall y in the code behind.

    Please help.

    Robert
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    So, when you make a change in the codebehind, just call the method that is the handler yourself:
    Code:
    ApproverCopy_TextChanged(ApproverCopy, null);

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      That would be because the server code executes before the page even loads and the handler is javascript based (causes a postback to your server-side code)

      Comment

      • RobertTheProgrammer
        New Member
        • Aug 2007
        • 58

        #4
        Ah, I found I misstated something in my question. I'm not really populating the field from the codebehind, but rather from javascript. I basically have a modal popup window that grabs a value from the user and when they dismiss the popup, it puts the value into the textbox field. I then would like it to kick off my code (from the OnTextChanged event), which grabs that value.

        Robert

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Well the on textchanged in javascript doesn't fire unles you "lose focus" on the control.
          Seems kinda dumb to me, but that's how I've seen it work before. You might able to call a focus() and then a blur() on the textbox to see if that triggers it?

          Comment

          Working...