In an online B2B application (build using ASP.NET webforms on .Net framework 4.7.2), we want to restrict users to open 3 to 4 tabs of a browser at a time to control the load on server, as the no. of users is high, unlimited tabs by users may impact its performance.
We tried to add JS code at Option Link to count no. of options opened by users, But how to control closing of tabs?
seems like that you want achieve, that is very difficult in client side, because at the end of scenario we have to depend for server for count, and If you can achieve this by JS(by calling AJAX), still It will not correct all the time(like It will not work in browser crash or anything It may be).
So I am telling another solution which is best suitable for this one I think, you can create webSocket connection for every logged in user, and then check If that user has max connection then you can simply display prompt,
advantage of this solution is: You can also check cross browser(Like If someone is logged in one browser and open 3 tabs, and same user also use another browser and also using 3 tabs there, you can simply take over this too).
Thanks, Let me know if you have any query/question. I will try to give best solution :)