Remembering original textbox values for comparison

Last post 07-07-2009 8:35 AM by otherjugdish. 2 replies.

Sort Posts:

  • Remembering original textbox values for comparison

    07-06-2009, 1:50 PM

    What is the best way to go about storing original textbox values, so that when a user changes them, I can compare the two and run the correct SQL statement?

    Example:

    select case newval

    case 0

      delete statement

    case else

      if oldval>0 then

         update statement

      else

         insert statement

      end if

    end select

     

    I have the record key and newval values, I just need oldval. I've read some about storing them when the listview is bound to the data, but I seemed to be only storing zeroes, which probably means that I was storing the pre-bound value. I tried to use the OnDataBound event to store textbox.text in oldval. What should I do? What are some ways to do this?

  • Re: Remembering original textbox values for comparison

    07-06-2009, 2:16 PM
    Answer

     Hi,

    you can use hidden variable to store old values, you can access from server side too.

    <input type="hidden" id="hdata" runat="server"/>

    Thanks :)

     

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Srinivas Kotra.


  • Re: Remembering original textbox values for comparison

    07-07-2009, 8:35 AM

     Thanks, that worked perfectly.

Page 1 of 1 (3 items)