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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jun 8, 2011, 1:12 AM EDT
link1 Click here
link2 Click here
Link 3 Click here
Rohatash KumarRank #12 · 57.7K reputationPosted Jun 8, 2011, 1:39 AM EDT
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.
Suthish NairRank #92 · 22.8K reputationPosted Jun 8, 2011, 2:27 AM EDT
ViewState["2"] = TextBox2.Text
Something like this...
Or explain the thread with more details.
Rohatash KumarRank #12 · 57.7K reputationPosted Jun 8, 2011, 3:15 AM EDT
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.
VulpesRank #55 · 29.2K reputationPosted Jun 8, 2011, 7:46 AM EDT
// store
Pradeep ChandrakerRank #941 · 2.2K reputationPosted Jun 9, 2011, 6:17 PM EDT
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?