When to use and which to use in ASP.NET State Management techniques? [Resolved]

Posted by Nav234 under ASP.NET on 8/11/2010 | Views : 3458 | Status : [Member] | Replies : 6
Hi all,

Iam trying to understand concepts on ASP.NET State Management .

URL : -http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

Now i know definitions for different state management techniques both client side and server side .

But iam not clear on which technique to use in what situation.
Iam confused in some scenarios like instead viewstate ,why cant we use session or cookies or something else.

So Kindly can any help me understand when to use what and when
not use which one ?

thanks in advance

S.Naveen...


Responses

Posted by: Shankul2784 on: 8/11/2010 [Member] Bronze | Points: 50

Up
0
Down

Resolved

Hi,

View state - When you want to store the data for that page only then you can use the view state, which is convenient method.

Hidden fields- when the information is not so important, in that case you can store the info in hidden field. if you compare with the view state, we can encrypt the information by setting the properties.

Cookies- if you want to set information at client side & the information is not too much important then cookies are used.

Query strings- If you want to send information like id from one page to another page then query strings are used.

Application state- If you want to store the information across all users then you can use the application state. A good example is if you want to show the no of users visited to the site then then you can store the count in application object.

Session state- this is used when your data is important & you dont want to visible to the client side or you want to store the per user data across the application then you can use the session state.


I hope, this will help you.



Thanks & Regards,

Shailesh

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

Posted by: Nav234 on: 8/12/2010 [Member] Starter

Up
0
Down
Thank you Mr.Shailesh ,

that was good definition.further indetail if u have any notes do post link here.

why i posted my question is because in recent interviews ,the interviewer confused me by asking why cant we use session in place of view state or something else like that,i couldn't crack interview that time.

but this would help me now i hope.

Can i get ur mail ID ,so that i can get knowledge transfer from you also tatz y.

thanks & regards


S.Naveen...

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

Posted by: Bathala.ramesh430 on: 12/23/2010 [Member] Starter | Points: 25

Up
0
Down
Thank Q. It is help me so much.
Please tell me in real time where it can be used ?

Thanks & Regards
Ramesh.B

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

Posted by: Bathala.ramesh430 on: 12/23/2010 [Member] Starter | Points: 25

Up
0
Down
Thank Q. It is help me so much.
Please tell me in real time where it can be used ?
Please send me answer to my mail ID: rameshnkdp@gmail.com
I need urgent................

Thanks & Regards
Ramesh.B

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

Posted by: T.saravanan on: 12/23/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Ramesh.B,

Don't give your mobile no in this section.May be its affected you so kindly erase it else omit it.



Thanks,
T.Saravanan

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

Posted by: Bathala.ramesh430 on: 12/25/2010 [Member] Starter | Points: 25

Up
0
Down
thanks for advice...........

Thanks & Regards
Ramesh.B

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

Login to post response