static variable in

Total Post:135

 1184  View(s)
Rate this:

I would like to have kind of static variable but isolated for each user session so is static variable in common to all users ?


If yes is there an easy to emulate what I want without using user session explicitly ? I cannot use Viewstate either as I'm using MVC (or am I mistaken ?)

  1. Post:378

    Re: static variable in

    Hi Chintoo, 

    A static variable will be common for all sessions yes.

    If you want to keep per-user-session data you have three options:

    ·        Use built in Session handling.

    ·        Set a cookie.

    ·        Pass the data as a hidden form field that is posted to the server (works for places where you have a form anyway).

      Modified On Apr-06-2018 11:16:26 PM