M
M
mustiks2016-03-27 18:26:32
ASP.NET
mustiks, 2016-03-27 18:26:32

How can you make sure that the user has closed the web page?

It is necessary to block the editing of the resource if it is already open by someone, i.e. if one of the users has opened a certain page, then others have read-only access to it. How can you track that the user who occupied the resource released it (closed the page) and it again became free for editing?
A project on ASP.NET MVC 5, I'm looking towards SignalR, but isn't it too much, maybe there is an easier way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2016-03-27
@mustiks

I look towards SignalR, but isn't it too much

Not too much.
IMHO the only reliable way to find out when the client has dropped off is to maintain a constant websocket connection with it.
Established a connection - locked the resource.
Broke - broken.

D
Dmitry Kovalsky, 2016-03-27
@dmitryKovalskiy

Yes, there are simpler solutions, and if you added client script tags (javascript, jquery), you would get an answer 10 times faster. There are onunload and onbeforeunload events. They are not too cross-browser and may not work in some places, but it will be easier than using SignalR.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question