Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with postback

Status
Not open for further replies.

chimaera

Programmer
Oct 29, 2001
10
US
hi there... just started using asp .net and i'm facing a slight problem with postback...

i have a textbox which accepts a user input and some buttons doing some stuff...
upon clicking the button and after the page does a postback... i can no longer refer to the value in the textbox using textbox1.text

am i doing something wrong here??? the text in the textbox is still there except i cant get the value out...

pls help... code snippets would be very very helpful...

thanx

regards,
Peter
 
chim: If the text is still in the textbox it should be accessible - hard to understand why that would happen - someone may drop by with a suggestion. So long as viewstate is active (default) which it seems to be, since the page returns with the text, you should be able to get at it. How are you referring to it?
 
i'm refereing to it using textbox1.text

and viewstate is active...

unfortunately... i get a blank when i assign it using a=textbox1.text

does the page redefines all the controls and variables when it reloads as i get the same thing with variables...
 
Yes, everthing is reloaded and then viewstate is used to put back values into controls for which the value was not changed. Variables are initialized and there is no viewstate unless you saved values to the viewstate and restored them yourself. When you say viewstate was active, was it specifically active for that textbox? What is in the EnableViewState property for the textbox. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top