By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

getting modified text box values

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.