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

getting modified text box values

Hi,
I have an aspx page, that in the PageLoad sub, gets values from a specific
record in a database as where the record id is retrieved from the
querystring. Thesee values are then used to populate a series of text boxes,
radio button selections and drop down list selections. This all works.

I run into a problem when I change the values of one of these populated
items. When a button is clicked to update the database with the modified
data, the event fires, but the data is not updated. If I hard code string
data in, instead of using the data from the textboxes (or drop list or radio
button), the changes appear in the database as expected.
Why are the changes to the text box data not appearing in the db, and how
can I fix this?
TIA,
Mark
Nov 18 '05 #1
3 1485
Hi Mark,

It is hard to diagnose without seeing your code, but have you remembered to
use "if not ispostback" in the Load event? You don't want to keep filling
the textbox with the original value.

Ken

"Mark" <py*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,
I have an aspx page, that in the PageLoad sub, gets values from a specific
record in a database as where the record id is retrieved from the
querystring. Thesee values are then used to populate a series of text
boxes,
radio button selections and drop down list selections. This all works.

I run into a problem when I change the values of one of these populated
items. When a button is clicked to update the database with the modified
data, the event fires, but the data is not updated. If I hard code string
data in, instead of using the data from the textboxes (or drop list or
radio
button), the changes appear in the database as expected.
Why are the changes to the text box data not appearing in the db, and how
can I fix this?
TIA,
Mark


Nov 18 '05 #2
It sounds like your page is resetting the values to the original data from
the database on PostBack. Is the code that initializes everything executing
each time Page_Load is called, or just during the initial Page_Load?
Remember, Page_Load gets called once when the page initially loads, once
during each PostBack.

Make sure your initialization code in Page_Load is wrapped in the following
(if you're using C#):

if (!IsPostBack) //not in PostBack
{
....
}


"Mark" <py*******@hotmail.com> wrote in message
news:#7**************@TK2MSFTNGP09.phx.gbl...
Hi,
I have an aspx page, that in the PageLoad sub, gets values from a specific
record in a database as where the record id is retrieved from the
querystring. Thesee values are then used to populate a series of text boxes, radio button selections and drop down list selections. This all works.

I run into a problem when I change the values of one of these populated
items. When a button is clicked to update the database with the modified
data, the event fires, but the data is not updated. If I hard code string
data in, instead of using the data from the textboxes (or drop list or radio button), the changes appear in the database as expected.
Why are the changes to the text box data not appearing in the db, and how
can I fix this?
TIA,
Mark

Nov 18 '05 #3
Ooops..... I think that'll do it.........
compltely slipped my mind.

Thank you both for the kick in the pants ;-)
"Warren J. Hairston" <wh*******@logicaloperators.com> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
It sounds like your page is resetting the values to the original data from
the database on PostBack. Is the code that initializes everything executing each time Page_Load is called, or just during the initial Page_Load?
Remember, Page_Load gets called once when the page initially loads, once
during each PostBack.

Make sure your initialization code in Page_Load is wrapped in the following (if you're using C#):

if (!IsPostBack) //not in PostBack
{
...
}


"Mark" <py*******@hotmail.com> wrote in message
news:#7**************@TK2MSFTNGP09.phx.gbl...
Hi,
I have an aspx page, that in the PageLoad sub, gets values from a specific record in a database as where the record id is retrieved from the
querystring. Thesee values are then used to populate a series of text

boxes,
radio button selections and drop down list selections. This all works.

I run into a problem when I change the values of one of these populated
items. When a button is clicked to update the database with the modified
data, the event fires, but the data is not updated. If I hard code string data in, instead of using the data from the textboxes (or drop list or

radio
button), the changes appear in the database as expected.
Why are the changes to the text box data not appearing in the db, and how can I fix this?
TIA,
Mark


Nov 18 '05 #4

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

Similar topics

7
by: KK | last post by:
Please help! I am currently experiencing a bug in Safari v125.9. When I modify the value of form input box and then get the innerHTML property of the surrounding div object - I am returned the...
21
by: Gerry Abbott | last post by:
Hi All, If completed a script which parses a string into fragments (fields), then assigns these substrings into an array. I wish to turn this into a function to which i can pass the string....
3
by: C# Learner | last post by:
The following code gets the *body* of an HTTP message: <code> response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream(),...
3
by: ton | last post by:
How can I detect that the user has modified the data on the page where several textboxes, checkboxes and dropdownlist exist. Ton
7
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
6
by: timbobd | last post by:
I have a Windows form that displays a database table in a DataGrid. When you click on a row, the row's values get copied to bound TextBoxes below, and when the "Save" button is clicked the database...
7
by: Brian Tkatch | last post by:
This is a shell question (bash), but i'm more familiar with this group, so i hope noone minds. I have a bash shell script which needs to query the database and return information into a...
3
by: lakepeir | last post by:
Hello, I'm have defined a combobox on form2 and I'm trying to use that value in form1. I have defined a global value so that form1 can retrieved the modified value as: Public Shared...
10
by: Cliff | last post by:
Greetings, I have been trying to teach myself C++ over the past few weeks and have finally came across a problem I could not fix. I made a simple program that prints out a square or rectangle...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
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?
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.