asp.net mvc - How to use a global variable in MVC -


i want create single instance of class should available controllers. it's bit shopping cart in system 1 user. have been using session state times out after while , that's problem.

i'd consider using application state , wiring in global.asax. how things done in mvc or there approach fits better framework?

use singleton. have class class method return if detects has allocated. other allocate , return itself. go here info on how. http://www.johnwordsworth.com/2010/04/iphone-code-snippet-the-singleton-pattern/


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -