How to block asp.net page from multi-user editing?

I have a page with a series of checkboxes that can be changed by authenticated users. I need to make this page available to only one person at a time. Therefore, if a user logs into it and edits one of the flags, no one can enter the page and change the other flags.

I thought of a link to the edit page and a link to the read link (all controls are disabled), and then set the database flag if the user enters edit mode, but I'm worried that I don’t know if the user has changed anything then and then just x'd from the browser / application, blocking everyone else.

This is an internal application for the company. Has anyone done something like this?

Any ideas or thoughts or suggestions?

thanks

+3
source share
6 answers

We have this feature in an older ASP application. The user will load data using some type of primary key. We put a record in the database to block this page. If they navigate the site correctly, it will unlock resources at this time.

Other users who open this page will receive an indication that the page is locked and a read-only version is displayed.

It would be pretty trivial to encode an unPageUnload AJAX call to reset the browser close lock. We do not find that this is a big problem, and old locks are simply cleared by the evening process if it is more than 4 hours.

. , , AJAX, , . , .

, , .

+5

, , , , . x , , , , ( ).

+2

script ? , SO , , , " , ". - " ".

ASP.NET AJAX - . , , "IN EDIT". . , "LOCKOUT REQUEST" 15 , "LOCKOUT GRANTED" . , , , , ( ). , , , .

, . HTTP. , ?

+1

db , , , .

"" .

(.. UPDATE ... WHERE ID = myID AND VERSION = myversion) - 0 , , - , , - , ..

+1

?

, , , ( datestamp, ; ). ; , . , .

0

, , .

, , AppVariable Map Dictionary, . , , , , . AJAXy, UpdatePanel , , , .

, , , ( , ), , , , , / .

: 1) , /. 2) webfarm, , .

?

0

Source: https://habr.com/ru/post/1707891/


All Articles