So... where are these textboxes actually created? Are they WebServer controls, or just HTML "input" fields?
If they are Webserver controls, ask yourself why?
If they aren't, then get the values out of the Response object.
When is "filldata" executed?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
When the user submits the form, the values from the form will be inside the Response object. You can get the values there, if you like.
The ASP.NET Page Lifecycle goes through a series of discrete steps, well-documented on my site and elsewhere on the web.
Any static web controls, meaning, those controls that you built into the page via the Visual Studio toolbox/designer, are re-created, and the values from the Response object bound to them as part of the LoadPostBackData stage in the lifecycle.
If these textboxes are dynamically created, via some server-side event procedure, then the controls need to be re-created, by you, in every code path that might need them and their values, prior to the LoadPostBackData stage, so that they can be properly bound.
Thus my original question, which you never answered and isn't displayed in your code:
So... where are these textboxes actually created?
Also, examine your code-path. How are you preventing your step "1" from occuring when the user submits the form? From the code you posted, evidently you're calling "filldata" on Page_Load. Thus, everytime you run your code, you're going to ignore what the user entered, and instead go get what's currently in the database. I hinted at that in my first response, as well.
Before I can help any further, you need to re-read and think through the answers you've already been given.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
That is not a correct answer. ViewState doesn't have anything to do with the value of HTML form objects and their corresponding server controls, only with the state of certain server controls that do not render as HTML Form objects.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Hey buddie, you need to put your first part of your data within an IsPostBack portion. The reason why it is becoming the old data is that when you postback to the server, it still refreshes the page which plays page_Load once again, where you set the t1 and t2 values. So they are being reset. You need to put your page_load information into a Page.IsPostBack statement:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack then
da.Fill(ds, "ramtable")
Dim rno As Byte
rno = 0
call filldata(rno)
End If
End Sub
Now the page_load information doesn't re-execute when you postback to the server, which keeps your information in the textboxes.
If you have any questions, don't hesitate to PM me.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
And now I just realize this post is years old... thanks for bringing up the old post to complain... psh.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
And complaining that volunteer help does not meet your personal expectations is rude as well.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Well, those who are seeking help for free from others certainly have another option beyond wading through "clutter" - they can figure it out for themselves.
All of the help offered here on DaniWeb is the result of someone taking time out of their day to try and help out someone they do not know for absolutely nothing in return. It comes across as rather pathetic that you would choose to complain about the form that it took. I suppose just saying "Thanks, that helped." never crossed your mind.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
>People don't always post to help others. They could be posting to show off or to be rude, as in your case, when you called me "pathetic."
Do you honestly feel that you have been helpful in dragging this dead thread back up to complain? I don't see that you have added any technical value to it.
>As a moderator, you ought to be *supporting* my constructive criticism of an unhelpful approach.
I don't really believe that your reply was constructive. Criticizing a post that is three years old does not really come across as helpful and calling it 'rude and ineffective' is not what I would consider a constructive lead-in.
I also do not believe that arguing this further here is adding any value. You've stated your thoughts on it and I have stated mine. If you feel you must discuss it further, I would ask you to do so via PM. I would prefer to leave this thread open for potential future on-topic discussion.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847