Question

I have been confused about this for a while, so I thought I will ask here. I have noticed that a lot of controls can store objects in winforms but not necessarily in web forms. For example, a checkedListBox in winforms can save objects while checkBoxList in Web forms can not. Can anybody tell me why is that and also, if there is any link to a list where I can see all the controls in both winforms and webforms which do or do not store objects.

Thanks.

Was it helpful?

Solution

The difference is in the state. WinForms use statefull design, WebForms use stateless design or sometimes sticky session. I don't have a list, but those are quite different technologies and I would not want to mix them.

Stateful

Object state is retained along the program lifespan. Unless you explicitly or implicitly request an object termination, it will stay in memory.

Stateless

This is used in request-response architecture. A client issues a self-contained request, a server processes it and returns a self-contained response. Data on the server gets cleaned. This is why web applications can support many concurrent users without dying from out of memory exceptions. There is some minor state saved though. In web applications it is usually stored in the request and response in form of hidden fields or cookies.

Sticky session

This is used in web farms and load balanced environments, so requests from the same user usually travel to the same server. This is good because the server may cache some data about the user's request and form a response faster.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top