473,396 Members | 1,913 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.

Asp.Net 2.0 - Textbox previous value

How do I get the previous value of a text box ? Is there a way to access
the TextBox control state ?

Thanks for any direction,
Steve

Jan 9 '08 #1
2 1625
"Steve" <st*****@hotmail.comwrote in message
news:09**********************************@microsof t.com...
How do I get the previous value of a text box ? Is there a way to access
the TextBox control state ?
There are some clever tricks you can do with ViewState, but by far the
simplest (and 100% guaranteed) method is to include a hidden field
containing the initial value of the textbox and then compare the two at
postback:

<asp:TextBox ID="MyTextBox" runat="server" Text="Hello" />
<asp:HiddenField ID="MyHiddenTextBox" runat="server" Value="Hello" />
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 10 '08 #2

"Steve" <st*****@hotmail.comwrote in message
news:09**********************************@microsof t.com...
How do I get the previous value of a text box ? Is there a way to access
the TextBox control state ?

Thanks for any direction,
Steve
This video talks some about postback
http://msdn2.microsoft.com/en-us/beginner/bb308809.aspx
Jan 10 '08 #3

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

Similar topics

8
by: asd | last post by:
I need to find the value/index of the previously selected item of a select list. That is, when the user selects an item from the list and a certain condition elsewhere in the form is not met, I...
1
by: Blake Versiga | last post by:
When editing a datagrid (C#) I need to know if the user changed the value of cell AND what the previous value was. Is this possible? If so how do I get the previous value or at least if the...
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...
5
by: hans.bonefaas | last post by:
Hi all, I hope someone can help me with the following problem in ASP.net. I want to edit the information for a record in a database (MS Access). On the page I placed several textboxes and...
2
by: jason | last post by:
hello. i am just trying to save a TextBox.Text value to a database, but strangely, when the value is changed on the web form, the changes are not recognized in the event where i try to save the...
6
smiley22
by: smiley22 | last post by:
I would like to know how to check the current value and the previous value entered by user before changes. for example, the form will allow user to enter customer number. The first time user enter...
2
by: David Jackson | last post by:
Hello, I'm using VS.NET 2005. I have a ListView populated with data pulled from a SQL Server database. I have wired up a SelectedIndexChanged event, but I can't find any way of retrieving...
0
by: Mort Strom | last post by:
I have ViewState enabled for a TextBox and parent form. On postback, how do I get the TextBox previous value ?
1
by: =?Utf-8?B?cmxt?= | last post by:
I have a gridview, and in the RowDataBound event I do some processing on the data. I need to know if the one of the columns has changed from its previous value, but I do not see how to get the...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.