Will declaring a dataset as STATIC in ASP.net website help in persisting data across post backs?
I was looking at an application and somehow a static dataset was able to persist the data even if we closed the application and opened it again.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it can.
staticvariables are stored in server memory. Note that they are shared among all users (likeApplicationstate) and it might require a locking mechanism to ensure thread safety.Note that it will be gone if the application ends.