Help! text field values lost before updating the database

Farzeen

New member
Joined
Apr 5, 2006
Messages
4
Programming Experience
5-10
i am having a terrible problem while saving changes in a textbox field to database. The peroblem is not with the database rather seems to be some session problem. All works fine if page is loaded with a no parameter url, and the record is fethed manually, but suppose i send the number in url, the data is loaded automatically and all fields are set accordingly on page load. ALL WORKS fine except my save changes button.

[http://crf/(d5md1s45pvdzzb55gcsbjwzk)/CRFFORM.aspx?PCRNO=CO/DHCL/1/4/5/2006

here in this url it takes a PCRNo with it.
everytime i change the description textbox and try to save changes what happenes is that it loads the page again, paramater is still there, as page is loaded the values changed in the text field is lost and page is loaded again with the same old values from the database.

I M just stuck to it..
CAN ANY 1 HELP ME..
 
re:help text field....

put the code in the page_load event within autopostback .i.e.,

if not ispostback then
''your code in page load goes here
end if
 
re:is that fine

if it works it's obviously fine.
But if you don't want the page to load each time the page is posted from itself, do keep the page load code part inside a postback event check..
 
try moving your code into Page_PreRender instead of Page_Load. When Page_Load runs the client-side form data has not been processed yet so the values of your textboxes will be blank until after Page_Load is complete.
 
as the others alluded to....

are you filling the data for the textboxes in your page load without checking if it is a postback?

if you are they are getting set back to their inital state before whatever you event is that updates your DB
 
Back
Top