G
Guest
I have several text boxes like FirstName, LastName, etc; the usual.
When the page is loaded I fill in the values from a member record.
Like:
Session("FirstName") = DS.Tables("Member").Rows(0)("firstName") & ""
Then show in the textbox like:
Me.tbFirstName.Text = Session("FirstName")
Then what I want to do is be able to determin if the user has made a change or edit like this:
'the real question is where to put this piece of code - textchanged event?
Dim strChanges As String
If Me.tbFirstName.Text <> Session("FirstName") Then
strChanges &= "<b>First Name: </b>" & Me.tbFirstName.Text & "<br>"
End If
''''''''
Then I can carry all the changes over like this:
Session("Changes") = strChanges
My problem is that when I try to compare tbFirstName to Session("FirstName"), I'm not getting the edited value of tbFirstName. Its returning the viewstate value which makes sense but then Me.tbFirstName.Text <> Session("FirstName") is never true.
I tried to put this in the tbFirstName_textChanged event and it knows the text changed so it does execute but it still gives the unupdated viewstate value of tbFirstName not the edited value. I can't do a postback to update the value because I know the person I'm doing this for won't like it.
Is there anyway to get at the changed value without doing a complete postback?
Is there someway to update the view state here:
'the real question is where to put this piece of code
Me.viewstate.updateSomehow
Dim strChanges As String
If Me.tbFirstName.Text <> Session("FirstName") Then
strChanges &= "<b>First Name: </b>" & Me.tbFirstName.Text & "<br>"
End If
''''''''
When the page is loaded I fill in the values from a member record.
Like:
Session("FirstName") = DS.Tables("Member").Rows(0)("firstName") & ""
Then show in the textbox like:
Me.tbFirstName.Text = Session("FirstName")
Then what I want to do is be able to determin if the user has made a change or edit like this:
'the real question is where to put this piece of code - textchanged event?
Dim strChanges As String
If Me.tbFirstName.Text <> Session("FirstName") Then
strChanges &= "<b>First Name: </b>" & Me.tbFirstName.Text & "<br>"
End If
''''''''
Then I can carry all the changes over like this:
Session("Changes") = strChanges
My problem is that when I try to compare tbFirstName to Session("FirstName"), I'm not getting the edited value of tbFirstName. Its returning the viewstate value which makes sense but then Me.tbFirstName.Text <> Session("FirstName") is never true.
I tried to put this in the tbFirstName_textChanged event and it knows the text changed so it does execute but it still gives the unupdated viewstate value of tbFirstName not the edited value. I can't do a postback to update the value because I know the person I'm doing this for won't like it.
Is there anyway to get at the changed value without doing a complete postback?
Is there someway to update the view state here:
'the real question is where to put this piece of code
Me.viewstate.updateSomehow
Dim strChanges As String
If Me.tbFirstName.Text <> Session("FirstName") Then
strChanges &= "<b>First Name: </b>" & Me.tbFirstName.Text & "<br>"
End If
''''''''