Doing calculations an save on losefocus

3 posts, 0 answers
  1. Neil N
    Neil N avatar
    75 posts
    Member since:
    Aug 2012

    Posted 27 Sep 2013 Link to this post

    More of a best practices type question:

    Suppose I have 20 numeric textboxes. As a user enters a number in each one and tabs off the textbox I want that number to be saved to a database and a "total" label to be updated.  I'm looking for a fast response time so ideally the front end wouldn't wait for the database update and commit to be acknowledged.  What would be the best way to architect this?
  2. Neil N
    Neil N avatar
    75 posts
    Member since:
    Aug 2012

    Posted 30 Sep 2013 Link to this post

    Sorry, the functionality described above should fire on OnValueChanged, not OnBlur.  I'd also like the background to change when OnValueChanging is fired and then change back when OnValueChanged is fired.  As this behavior should be standard throughout the web app (consisting of hundreds of RadInputs I'm thinking I need to extend the control. Possible?
  3. DevCraft R3 2016 release webinar banner
  4. Konstantin Dikov
    Konstantin Dikov avatar
    1755 posts

    Posted 02 Oct 2013 Link to this post

    Hi Neil,

    I have prepared a sample project for you with extended RadTextBox with assigned event handler for the client-side "OnValueChanged" event. You could add an RadAjaxPanel in the page and on the "OnValueChange" event to fire AJAX request and handle it on the server (get the text boxes values and save them). 

    Additionally, please note that "OnValueChanged" is firing right after the "OnValueChanging" and I am not sure if it will be appropriate for changing the background color. Instead, I have set the "cssClass" property and to the CSS class I have set the "background" of the input element when on focus. 

    Hope that helps.


    Konstantin Dikov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top