开发者

Maintain State of checkbox in asp.net C#

开发者 https://www.devze.com 2023-03-26 17:38 出处:网络
Hey开发者_如何学运维 Frens I am making one project in asp.net C#, in which i have made one column of datagrid view as Checkbox.

Hey开发者_如何学运维 Frens I am making one project in asp.net C#, in which i have made one column of datagrid view as Checkbox. My aim is that if one user checked the checkbox than when another user login the page checkbox which are checked should be checked and unchecked one should be unchecked i.e., it should hold its previous state.

So plz suggest me the best and efficient way for this


Database would be the cleanest approach, imo.

But as stated above ASP.NET processes share their "class wide" variables between multiple Users. So you could use a dictionary to map the Boolean values with Users.


you need to save the state for that checkbox. Now either you can use a static variable to hold the state of the checkbox if the code is to run on a single server or you can use database in case there would be multiple application servers.

0

精彩评论

暂无评论...
验证码 换一张
取 消