I need to make the session readonly so I can establish multiple requests to a page that uses sessions variables but in the readonly mode.
Since all the process are performed on my server control I need a way to make the session readonly programmatically.
If you use ASP.NET MVC, you can use the SessionStateAttribute
class on the controller level.
[SessionState(SessionStateBehavior.ReadOnly)]
If you want to control the behavior on an action level, you can use this:
https://www.c-sharpcorner.com/UploadFile/ff2f08/session-state-behavior-per-action-in-Asp-Net-mvc/
If you use ASP.NET Web Forms, I am not quite sure, but it should be something along these lines...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With