简体   繁体   English

如何避免在c#中的新选项卡中两次打开同一窗口

[英]how to Avoid open the same window twice in a new tab in c#

How to avoid to open same window of existing website(window) in new tab 如何避免在新标签页中打开现有网站的相同窗口(窗口)

for eg.. if i have a page www.mysite.com/page1.aspx if i copy this URL and paste in new tab of the browser than a popup or message should be appear(alert-- you have already open this website) 例如..如果我有一个页面www.mysite.com/page1.aspx,如果我复制此URL并粘贴到浏览器的新选项卡中,则弹出窗口或消息应该会出现(提醒-您已经打开了此网站)

Note: if we reload or refresh the previous page than alter should not be appear .means only one page can be open at a time 注意:如果我们重新加载或刷新上一页,则不应显示alter。一次仅意味着可以打开一个页面

It should be done in scripting only, i need your valuable advice thanks in advance 应该只在脚本中完成,我需要您的宝贵建议,在此先感谢

Create a cookie, set its value to true on page load and false on log off. 创建一个cookie,在页面加载时将其值设置为true,在注销时将其值设置为false。 check if a cookie is true and same page loaded show your message. 检查Cookie是否为true,并且加载的同一页面显示您的消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.net C#避免两次打开同一窗口 - ASP.net c# Avoid open the same window twice 如何在C#中的同一窗口中打开新表单窗口? - How to open a new form window within same window in C#? 如何从C#中的代码在新标签页/窗口中的特定部分打开pdf - how to open pdf at particular section in new tab/window from code behind in c# 如何在ASP.NET C#中的新选项卡(NOT WINDOW)中打开页面? - How to open page in new Tab (NOT WINDOW) in ASP.NET C#? 如何在新选项卡或窗口中打开PDF文件,而不是使用C#和ASP.NET MVC下载它? - How to open PDF file in a new tab or window instead of downloading it using C# and ASP.NET MVC? 使用jquery / C#Razor在Same session中打开一个新窗口 - Open a new window with Same session using jquery/C# Razor 如何根据登录成功在新窗口/选项卡或同一窗口/选项卡中打开页面? - How to open page in new window/tab or in same window/tab depending on Login success? asp.net:如何使用c#在新窗口(不是标签页或当前页面)中打开新的asp.net页 - asp.net: How to open a new asp.net page in new window (not tab or current page) using c# 如何在同一窗口和同一选项卡中打开 URL - How to open URL in same window and in same tab 如何单击链接并在新选项卡中打开它 Selenium WebDriver C# - How to click a link and open it in a new tab Selenium WebDriver C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM