Why I get old values from a textbox even if they are changed?

 Hi to all,

i'm developing a dnn component that updates some data stored on the db.

 

To do so, i've made a simple select query to fetch the old values, then the onload event popolates a form using a VB codebehind.

To update the user changed data, i've insert a update_button, that the user must click in order to run the update.

in the codebehind, i've made a function raised on the  update_button.click event but when the update function collects the changed data, it still collects the old values, even if they are changed... WHY?

 

could someone help me?please :)

 

Thanks to all,

/D 

 

-1
gnasky
2/11/2008 2:37:34 PM
asp.net.presentation-controls 72751 articles. 2 followers. Follow

2 Replies
657 Views

Similar Articles

[PageSpeed] 31

Have you put an "If Not Page.IsPostBack Then" statement around your onload code? Failure to do this would cause you to pick up the same values each time.

 

Hope this helps 


Please mark posts as the answer if I was helpful. Thanks!

Visit my blog
0
ParrotBoy
2/11/2008 2:50:14 PM

 Yep! Big Smile Was That... i forgot that because... i'm novel in .net developing... Confused

Now works fine!

really really thanks!  


 

 

1
gnasky
2/11/2008 8:57:50 PM
Reply:

Similar Artilces:

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Change value into dg textbox but it catches old value
A datagrid is populated by an arraylist.When I'll update: Even changing text, i.e., writing a new text into textbox, the text continue the last one, without changesI turn off viewstate from textbox but nothing yet What is going on? Some help will be appreciated, thanks a lotBest regards,Ivan Andrade Are you dataBinding you datagrid on pageLoad?  If so, wrap if(!IsPostBack) around your databinding.If everything happens for a reason what is the reason for this error?...

Getting value from a textbox control that was filled with a value from javascript
 I have a textbox control (seen below txtMileageDollars1) that gets filled with javascript based on the number of miles a user types into another textbox (txtMileageMiles1) control.  When I post back with the submit button, the value is blank.  I've tried setting EnableViewState to false, but still cannot get a value on postback.  Does anyone have a solution?   Miles<asp:TextBox ID="txtMileageMiles1" runat="server" Width="50px"></asp:TextBox>   Total (txtMileageMiles1 * rate with javascript)<asp:TextBox...

how to change the value of checkbox when i change the value of textbox
i want the checkbox to change its value to unchecked when the textbox doesnot have anything i.e is value is "" and as soon as i enter anything to it, the checkbox should automatically change to checked. Can you please tell me how to do this Add to the textbox: OnKeyUp="CheckValue()" Add to the html: <script language="javaScript"> function CheckValue() { if (document.getElementById('textboxid').value.length == 0) { document.getElementById('checkboxid').checked = false; } else { document.getElementById('checkboxid').checked...

How to change the name value of attributes of textbox control that added DataGrid control?
I created a DataGrid and added a textbox control as a template column and binded a DataSet as for DataSource in my webform1.aspx. when you looked at the HTML format souce code of dataGrid after that have generated . i found all the textbox named with datagrid,textbox and a random number. The question is how can i rename it in running time? i have tried some times in different event of datagrid  but i fail! thanks. Of course the ID of the textbox will not be the same as you named it, because datagrid contains lots of rows and each row will have a textbox, so to...

How to get the Value from the Textbox ?Textbox is created by using add control function.
  Dim textWG As New HtmlInputText textWG.text="Wage Rate" textWG.ID = "txtWG" me.control.add(textWG) i write this code at form load.moreover this form have one save button to save the value from the "txtWG" to database this textbox will be appear when form finish load.but after click save button the value cant be save into database. tat textbox become empty when user click the save button. how can i get the value from that textbox ? Please advice me.Thank you You are using a HTML control and by default, HTML controls dont have a mechanism to pres...

how ontextchanged event in datalist fire and when that textbox value change than another textbox inside datalist value also change
 i have one datalist into which i used maskededit extender for time entry there is three textbox (1) start_time (2) end_time (3) duration so when enter  end_date value than this text box ontextchage event fire and duration will automatically calculate by(end_time - start_time) and display into datalist duration textbox. in datalist there is more than one item.i put some code so just check  <asp:DataList ID="CONTRACT_SERVICE_ITEM" runat="Server" RepeatColumns="1" RepeatDirection="Horizontal"      &nbs...

Changing a textbox value by changing 2 other textboxes inside of a FormView
Ok...here goes.  I want to be able to dynamically change the value of a textbox by changing the value of 2 other textboxes.  I have 4 textboxes, txt1, txt2, txtDB, and txtTotal.  These are all inside of FormView1 which is inside of UserControl1.ascx which is inside of UserControl1.aspx.   The goal is to have txtTotal read the summation of the 3 other textboxes.  txtDB has a bound value read from a database (why it is in a FormView).  txt1 and txt2 can be changed.  I want though, for the txtTotal textbox to change in real time wit...

problem with get value from textbox after get it value in load page
hi every one  i have problem with my web site when i get textbox value in load page   and Changed textbox the page do not take last value .   it take value in load page   this is code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)   TextBox1.Text = "aa" End SubProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) MsgBox(TextBox1.Text) End Sub   when i press button message write "aa" while i changed the textbox   please if enyone knowen help me &nbs...

Is there any way to get the old value of a control
I have a simple form with a text box and a button.. On display the text box will be loaded with some data from DB and the user can change and submit it back to the server.. Now i will get the new value of text from the textbox's Text property but is there anyway I can get the old value too.. from the viewstate or somewhere?? If this post was useful to you, please mark it as answer.ClientSideAsp.Net | Blog  You can follow one of the following approaches-1. Define a hidden control alongside your textbox in the following way-<asp:Hidden  id="oldTextBoxContent" ...

form getting old textbox.text values
I've got a form that when loaded loads it's values from the database and then allows you to edit them (using textbox controls). When you click save it adds what I would think should be the newly edited values into the parameters and updates the database. However it is instead loading the values prior to them being changed rather than the current values in the text boxes. Anybody know what would cause this?Could be WAAAY off in any suggestions I give in posts, so be on the lookout for stupidity :P As you have  not included any code samples, I can only suggest a possibility.Check...

Retrieve same data even if I changed value in textbox
Hi experts, I want to display a different record by entering a different Employee ID and click "GO" button (btnGO_Click), but the record is still retrieving the old record from the qureystring in the Page_Load (). How can I get around it? Explain in detail, when user search an employeeID in main.aspx, the Enroll.aspx will display all details about this employee by using querystring in Enroll.aspx. But if I entered another employeeID in textbox, it still retrieve the same details and ignore the new ID I entered. However, if I open Enroll.aspx directly and enter employid, ...

Get value from Gridview into textbox and dropDrownList controls
  Hi to all,I (newbie) want that when user click on ID field of Gridview.The values of that particular ID row should display in the textbox and dropdown list of the page.<asp:Label ID="lblAccessID" runat="server" Text="Access ID" Width="91px" Height="16px"></asp:Label>        <asp:TextBox ID="txtAccessID" runat="server" Height="12px" Width="126px"></asp:TextBox> <br /><br />        &l...

How to get the value of a dynamically created textbox control
Hi,  Can anyone tell me how to get the entered value from a dynamically created textbox apart from getting it from the TextChanged eventhandler? Regards, Vidya Friend, check this thread as similar scenario is discussed over http://forums.asp.net/t/1051661.aspx http://forums.asp.net/t/939377.aspx Another one Good luck!Please Don't forget to click "Mark as Answer" on the post that helped you.This can be beneficial to other community members reading the thread.  use Request["TextBoxId"] to get the value entered in it....Also white creating it rememb...

Web resources about - Why I get old values from a textbox even if they are changed? - asp.net.presentation-controls

The Day the Universe Changed - Wikipedia, the free encyclopedia
The Day the Universe Changed (subtitled "A Personal View by James Burke") is a British documentary television series written and presented by ...

PMD News Facebook Group Changed to Closed
... that were previously available only to Preferred Marketing Developers were opened to the public in July , but one of them, PMD News , was changed ...

Facebook changed my name to my unknown birth name, not my current legal name... - Facebook-Hilfeforum ...
I provided Facebook with my original birth certificate and my name change certificate - instead they changed my name to my birth name which I ...


Search Twitter - "If I didn't try this my life wouldn't have changed."
Sign in Sign up Search Refresh CHUA Chee Wee @ chuacw 4h If you put " If I didn't try this my life wouldn't have changed ." into your Twitter ...

Changed the AWS instance size on the Trex server from small to large, and now it runs much better. ;-) ...
A bunch of people made suggestions after reading today's Changes piece. The one that made the big difference came from my longtime programming ...

Economics : How has introductory economics changed as it's been taught in American universities over ...
Answer (1 of 5): Introductory economics has not changed enormously over the years. In part this is because much of introductory economics is ...

Changed Priorities Ahead - Flickr - Photo Sharing!
Explore joshinrhodeisland's photos on Flickr. joshinrhodeisland has uploaded 616 photos to Flickr.

IBM Centennial Film: 100 X 100 - A century of achievements that have changed the world - YouTube
The film features one hundred people, who each present the IBM achievement recorded in the year they were born. The film chronology flows from ...

PS: 'Changed man' Alec Baldwin coming to join stand against bullying
Hollywood star Alec Baldwin got a free ride with the Australian media this week &ndash; the actor enjoying gushing praise with news that he was ...

Resources last updated: 12/2/2015 11:16:58 PM