473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

access textbox value without postback

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
''''''''
Nov 18 '05 #1
1 3581
I would not use the Session State to do this. Instead I would use the
ViewState to store the First value and then compare against the one in
the TextBox.

As for the TextBox I am not sure why you are not able to get at the new
value. did you try the Form_Load Event. You can do a Respose.Write of
both the values here.

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JollyK | last post by:
Hello all, I have always been having this issue and wondering what the solution is. When I set the enableviewstate property to false for a textbox, the textbox always retains its value after a...
0
by: Sam Miller | last post by:
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") =...
5
by: John Cosmas | last post by:
I have a form that has a listbox on the top that is bound to a header table. When the page first loads, it paints the adjacent textboxes with data from the details table. However, when I postback...
1
by: guoqi zheng | last post by:
Dear sir, I have a textbox inside a repeart control, autopostback set to true for that textbox. When the value of this textbox changes, I need to access current row and update database. ...
0
by: datakix | last post by:
After 16 hours of frustration, I've managed to solve this problem for a project I'm working on. The 'trick' is set EnableViewState="False" for the asp:textbox inside the Repeater control. The...
4
by: MattB | last post by:
Hi. I'm working on an intranet application that requires a user to input information about themselves. I have a user control with a couple of textboxes that I want the user to enter their weight...
5
by: sklett | last post by:
I'm not real experienced with asp.net so this may be obvious. I've got a situation where some of my client side javascript is causing my posted form's controls to lose their values. In other...
2
by: wildman | last post by:
RE: Gridview textbox has data check without postback.. javascript? I have a gridview with a textbox. I can set the textbox to autopostback and check for a value in a prerender event to decide if...
4
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example...
7
by: adiel_g | last post by:
Hello Everyone, I created a custom control. On the CreateChildControls, I added a textbox to the control as follows: // TextBox TextBox txtValue = new TextBox(); txtValue.ID = "txtValue"; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.