|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TextBox.Text not getting the proper valueHi.
I have a form that is used to edit a row from SQL. The form textboxes are filled at page_load so that the user can see the data. User can make changes in the textboxes then click a button that uses SQL connection and UPDATE statement to save in DB. The problem is that textbox.text (in the code behind) is still getting the original data that was filled in from page_load. Any ideas why?? Appreciate it. * I used VS.Net debugger and added a watch on the textbox.text to see that this is a problem with my asp and not with my sql implementation. Perhaps you are setting the value from the database every time the page is
requested. 1. You set the textbox value (from the database) to "Test" in the Page_Load event. 2. The user enters a new value 3. The page posts back 4. You set the textbox value (from the database) to "Test" in the Page_Load event. 5. The button click event is called, and you save the value (now "Fred" again) to the database. To avoid this you should load the data from the database only when Page.IsPostback=False Show quoteHide quote "daiski" <dai***@gmail.com> wrote in message news:1116607019.551690.158130@g47g2000cwa.googlegroups.com... > Hi. > > I have a form that is used to edit a row from SQL. The form textboxes > are filled at page_load so that the user can see the data. User can > make changes in the textboxes then click a button that uses SQL > connection and UPDATE statement to save in DB. > > The problem is that textbox.text (in the code behind) is still getting > the original data that was filled in from page_load. > > Any ideas why?? Appreciate it. > > * I used VS.Net debugger and added a watch on the textbox.text to see > that this is a problem with my asp and not with my sql implementation. >
How to react to an ImageButon in a DataList ?
AutoPostBack How can I use my Own control in DataGrid? Can we have more than 1 'control to validate' for a single validat Datalist Dynamic Template Loading Problem Detailsview empty dataset insert TableCell Text Wrapping Problem! How to use Tab controls Infragistics UltraWebTab & RequiredFieldValidator Calendar Language |
|||||||||||||||||||||||