473,403 Members | 2,183 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,403 software developers and data experts.

Textbox in ASP

How can it be that TextBox.Text has an old value when I read it in to a
variable and I can at the same time see the new value in my browser. I would
guess that it has someting to do with a webpage lifecykle and viewstate but
I cant figure out how. If anyone has experiences like this I would
appreciate some advice. If not I will update this question tomorrow, now I
will go home.

Regards
Martin
Nov 17 '05 #1
2 1178
Martin,

Is it possible that your code is setting the text box value on page load?

If so use:

If Not IsPostBack Then
'---Set textbox text on the first page load only

End If

My guess is that you may be overwriting the new value when the client posts
back to the server.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Martin" <ma**********@avis.at> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
How can it be that TextBox.Text has an old value when I read it in to a
variable and I can at the same time see the new value in my browser. I would guess that it has someting to do with a webpage lifecykle and viewstate but I cant figure out how. If anyone has experiences like this I would
appreciate some advice. If not I will update this question tomorrow, now I
will go home.

Regards
Martin

Nov 17 '05 #2
Hi Martin,

Justin's suggestion sounds very good. If that didn't solve your problem,
then I suggest debugging. I think that some code is changing the value and
debugging can help you find that code.

First, look through the code to see if you can spot the error. Look at your
server and client code (java script). Then choose break points and debug
your application as described in these articles. If you see that the value
changes, then move your break points to zero in on the line of code causing
the problem.

316726 HOW TO: Debug an ASP.NET Web Application
http://kb/article.asp?id=Q316726

317699 HOW TO: Debug Client-Side Script in Visual Basic .NET
http://kb/article.asp?id=Q317699

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
Reply-To: "S. Justin Gengo" <sj*****@aboutfortunate.com>
From: "S. Justin Gengo" <sj*****@aboutfortunate.com>
References: <#Y**************@TK2MSFTNGP11.phx.gbl>
Subject: Re: Textbox in ASP
Date: Tue, 11 Nov 2003 10:27:43 -0600
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <u6**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 63.238.248.99
Path: cpmsftngxa06.phx.gbl!cpmsftngxa09.phx.gbl!TK2MSFTN GP08.phx.gbl!TK2MSFTNGP10.
phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190081
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Martin,

Is it possible that your code is setting the text box value on page load?

If so use:

If Not IsPostBack Then
'---Set textbox text on the first page load only

End If

My guess is that you may be overwriting the new value when the client posts back to the server.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Martin" <ma**********@avis.at> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
How can it be that TextBox.Text has an old value when I read it in to a
variable and I can at the same time see the new value in my browser. I

would
guess that it has someting to do with a webpage lifecykle and viewstate

but
I cant figure out how. If anyone has experiences like this I would
appreciate some advice. If not I will update this question tomorrow, now I will go home.

Regards
Martin



Nov 17 '05 #3

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

Similar topics

0
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
0
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
8
by: Marco Pais | last post by:
Hi there. How can I change the background color of a textbox when it gets the focus? I can handle the "Enter" event and do this private void txtDummie_Enter(object sender, EventArgs e) { ...
1
by: Andy B | last post by:
I have this code: protected void EditEventsWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { //get the values from the DetailsView TextBox StartTime =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.