473,431 Members | 1,648 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,431 software developers and data experts.

TextBox Field Values Disappearing

I'm having a rather vexing problem with my VB.NET ASP.NET application:

Briefly, on rare occasions, when a user of my site presses a button to move
from one record to another, and the Page_Load event fires, all of the TextBox
fields on the page are suddenly, and for no reason, blank.

To explain more fully, from time to time, blank records have been appearing
in the SQL Server database which is administred via my VB.NET Web app. To
determine why, I implemented an event tracker to see what sequence of events
may be causing this to happen. The tracker records the values of certain
TextBox fields on the page during certain events that occur on the server.

To illustrate what I found, assume a record is displayed on the form, and
the user presses a Get Next Record button. The sequence of events is as
follows: Page_Load, then Get_Next_Record_Click. Get_Next_Record_Click then
calls a Save function that saves the current record, then creates a
SqlDataReader object with the next record's data in it, then sends this
SqlDataReader to another function that populates the TextBox fields on the
page with the values from the SqlDataReader.

According to my event tracker, though, on rare occasions, when the Page_Load
event occurs, all of the TextBox fields on my page are inexplicably blank!
Thus when the Save function occurs, it overwrites the data of the current
record with blanks.

Does anyone have any idea why this is happening and/or what to do about it?
Nov 23 '05 #1
3 1689
You may want to investigate your page_load event. When you call a
button click event, it will cause a postback, when your page loads it
contains no data, and then calls your save() function. It would need
to re-load the data back into the textboxes, save the data, then load
the next record. Otherwise just use validation to dissallow navigation
until the changes are saved.

Nov 23 '05 #2
Thank you for your reply.

999 times out of 1000, the sequence of events I described in the OP work
perfectly. 1 time out of 1000, when the Page_Load event occurs, all the
Text_Box fields contain no data. Why does this work 99.9% of the time and
not the of .1%?

"cb****@duclaw.com" wrote:
You may want to investigate your page_load event. When you call a
button click event, it will cause a postback, when your page loads it
contains no data, and then calls your save() function. It would need
to re-load the data back into the textboxes, save the data, then load
the next record. Otherwise just use validation to dissallow navigation
until the changes are saved.

Nov 23 '05 #3
Come to think of it, this response makes no sense. How do I "re-load" the
data when the TextBox fields that contain the data are blank? From the
database? What about changes my users have made on the page? Discard them?

I think this is a BUG in ASP.NET.

Has anyone else encountered this?

"cb****@duclaw.com" wrote:
You may want to investigate your page_load event. When you call a
button click event, it will cause a postback, when your page loads it
contains no data, and then calls your save() function. It would need
to re-load the data back into the textboxes, save the data, then load
the next record. Otherwise just use validation to dissallow navigation
until the changes are saved.

Nov 23 '05 #4

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...
7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
1
by: jason | last post by:
I've seen a few posts on this issue, but no clear solutions. I have a mulitiline textbox inside a datagrid. I use TemplateColumn to define as multiline with 3 rows. I have other field types...
0
by: jrbrady | last post by:
When a user of my site presses a, say, button to move from one record to another, and the Page_Load event fires, all of the TextBox fields on the page are suddenly, and for no reason, blank. IOW,...
6
by: JohnR | last post by:
I have a table with 1 row which is used to hold some application wide items (one item per field, hence I only need 1 row). I want to bind one of the fields to a textbox. After setting up the...
8
by: John | last post by:
Hi, I am developing an application using VB.Net and hope that the textbox can process features which are similar to auto-complete features in Window. For example, when user types "ap" in a...
0
by: Tuomo | last post by:
Hi! I have a form (System.Web.UI.Page) that contains a DataGrid control and a DataTable that contains values for the data grid and that is data bound to the DataGrid. When I switch the grid to...
2
by: cephal0n | last post by:
I have this peroblem thats really bugging me for days, please have a patience to read it and help me find the probplem because I knew I missed it and just cant tell where. I have a table named...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
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
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...
1
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.