Hi,all
How we can storing and retrieving control data in View State in asp.net ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pradeep ChandrakerPosted Jun 9, 2011, 10:17 PM
By default the viewstate is enabled for the controls, so you don't have to do any extra operation to store or retrieve control values. During the page execution process the viewstate data automatically gets assigned to controls. There is no need to put extra burden on page, to have the same value in viewstate which is already there.
Let me know if you have any specific problem?
VulpesPosted Jun 8, 2011, 11:46 AM
// store
Rohatash KumarPosted Jun 8, 2011, 7:15 AM
Something like this...
But we can use single view state in place of ViewState["1"], ViewState["2"], that can store more than one textbox data and retrieve control data.
Suthish NairPosted Jun 8, 2011, 6:27 AM
ViewState["2"] = TextBox2.Text
Something like this...
Or explain the thread with more details.
Rohatash KumarPosted Jun 8, 2011, 5:39 AM
But my problem is that one page contains more than one control such as textbox. I want to store and retrieve control data using single View State in asp.net.
Jiteendra SampathiraoPosted Jun 8, 2011, 5:12 AM
link1 Click here
link2 Click here
Link 3 Click here