I want that a user of my application to enable or disable the viewing of a certain page for other users. For that i need , somehow an application variable, a bool to be set true or false whether the user decides to enable or disable the view for other users.
The functionality that i want is : when i click on a button to disable the view for a page(for other users that are connected to site), and when i press back to enable it .
I can achieve this with the use of a database, by changing the value of a field in a table with true or false.But this approach is ineffective and not elegant.
Can someone tell me how I can achieve this without using databases ? Is there any application variable / session variable / or cookie to achieve this ? Is there something that i should write in Global.asax ?
I use ASP.NET MVC 4..
Please help!
In you Controller declare "static variable" say
Set this value on click of button in the some action.
Example :