Problem with textchanged event

Discussion in 'ASP .Net' started by David, Dec 12, 2008.

  1. David

    David Guest

    Hi all,

    using C#, ASP.NET 2.0

    I have a textbox inside an AJAX updatepanel. The textbox has autopostback
    set to true and the textchanged event declared.

    When I come into the page, I pre-load the textbox with a value. If I change
    the value and either tab or click away, the event is fired, however, the
    textbox.text value has my OLD value not the new value I have just entered.

    I have done a quickwatch on it but cannot see any properties with my just
    entered value.

    I thought the whole idea was to have the new value at this point.

    Any ideas?
    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
     
    David, Dec 12, 2008
    #1
    1. Advertising

  2. David

    David Guest

    Doh!!!

    Found the prob...

    When the page loads, I fill my form. I don't have it in a !IsPostBack...

    I hadn't realised that even with ajax postback, the page_load runs, so it
    was preloading the textboxes BEFORE my event ran, therefore, putting my
    initial values back in so that when the event ran, it took my initial
    values.

    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
    "David" <> wrote in message
    news:...
    > Hi all,
    >
    > using C#, ASP.NET 2.0
    >
    > I have a textbox inside an AJAX updatepanel. The textbox has autopostback
    > set to true and the textchanged event declared.
    >
    > When I come into the page, I pre-load the textbox with a value. If I
    > change the value and either tab or click away, the event is fired,
    > however, the textbox.text value has my OLD value not the new value I have
    > just entered.
    >
    > I have done a quickwatch on it but cannot see any properties with my just
    > entered value.
    >
    > I thought the whole idea was to have the new value at this point.
    >
    > Any ideas?
    > --
    > Best regards,
    > Dave Colliver.
    > http://www.AshfieldFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Local franchises available
    >
     
    David, Dec 12, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page