.net - C# getting cookie data in the preinit event -


i have been seeing alot of code examples online of retrieving cookie data during preinit event, don't understand why want/have there. steadfast rule should getting cookie data in preinit event?

you don't have cookie data in preinit event, helps in 2 ways:

  1. you minimize potential of cookies getting modified in later events during page life cycle.
  2. if trying affect things in control tree using values read cookie, need value during pre-init ensure values have chance job. otherwise late , control collection have been built.

if don't need values affect page structure, or control flow, can read them whenever want. happens people use cookies change things in page life cycle read during preinit.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -