473,378 Members | 1,577 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,378 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 3572
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.