Hi Sir,
How can we show reading fetching data after closing and reopening of browser/ tab. using c# asp.net?
Hi Sir,
How can we show reading fetching data after closing and reopening of browser/ tab. using c# asp.net?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Apr 21, 2023, 4:06 AM
In order to persist data between browser sessions in an ASP.NET application, you can use various techniques such as cookies, session state, caching, and local storage. Here are some examples of how you can implement these techniques using C# in ASP.NET:
Cookies: Cookies are small text files that are stored on the user's computer and can be used to store user-specific data. You can use the following code to create a cookie:
To retrieve the value of the cookie, you can use the following code:
Session state: Session state allows you to store data that is specific to a user session. To store data in session state, you can use the following code:
To retrieve the value from session state, you can use the following code:
Caching: Caching allows you to store frequently accessed data in memory for faster access. To cache data, you can use the following code:
To retrieve the value from cache, you can use the following code: