I am using the following code to check whether the textbox value is changed. The text box value is initially retrieved from the database in a button click event.
Requirement:
I want to update another object(objTest2) property if the tbOffienotes textbox is changed. Further, I want to get only the newly entered text from the text box.
If Not tbOfficeNotes.Text.Equals(objTest.OfficeNotes) Then
Dim strComment As String = tbOfficeNotes.Text.Remove
(0, objTest.OfficeNotes.Length)
'Save the test2 object
objTest2.Comment=strComment
End If
Why don’t you store initial value in some control i.e
HiddenFieldand compare with current value…if changed then do your operation…