Can we store viewstate in session?

Posted by Allemahesh under ASP.NET on 7/16/2013 | Points: 10 | Views : 902 | Status : [Member] [MVP] | Replies : 5
Can we store viewstate in session. If yes, so the viewsate value is available in next page using session. I am right? Please help me.




Responses

Posted by: Kamlesh420 on: 7/16/2013 [Member] Starter | Points: 25

Up
0
Down
yes you can

kamlesh kuamr saini
Sr. devloper (asp.net)
new delhi

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rimi1289 on: 7/16/2013 [Member] Starter | Points: 25

Up
0
Down
Its like assigning a value to a "Session" from any source, which can be accessed through out the website.
The scope of a "ViewState" is limited to a single page.



Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/16/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
It means I can access the view state value of one page to another page using session. Right?

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jitendrasoft09 on: 7/26/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Allemahesh,

Yes. You are right as we can transfer viewstate data to another page. You can say you can maintain client data into server. whenever you want to use that data use it. Refer below link for more information-

 ViewState["myviewstate"] = "viewstate data";

Session["mysession"] = ViewState["myviewstate"];
Response.Redirect("Default3.aspx");


http://www.codeproject.com/Articles/101888/ViewState-Various-ways-to-reduce-performance-overh

Hope you have understood.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 7/30/2013 [Member] Starter | Points: 25

Up
0
Down
hi
try this link
i hope i will help you
yes we can store view state in session
www.hanselman.com/.../MovingViewStateToTheSessionObject.

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response