nachricht bei schließen des fensters oder neuladen

This commit is contained in:
ja
2021-11-05 16:12:19 +01:00
parent 935e21c077
commit c93022dd3c
3 changed files with 179 additions and 150 deletions

View File

@@ -142,10 +142,20 @@
<meta http-equiv="Page-Exit"content="blendTrans(Duration=0)"/> <meta http-equiv="Page-Exit"content="blendTrans(Duration=0)"/>
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="head" runat="server"> <asp:ContentPlaceHolder id="head" runat="server">
<script>
function unloadmessage() {
if (typeof contentunloadmessage == "function") {
contentunloadmessage();
}
}
</script>
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
</head> </head>
<body data-spy="scroll" data-target=".navbar" data-offset="50" onbeforeunload=" return 'Are you really want to perform the action?'"> <body data-spy="scroll" data-target=".navbar" data-offset="50" >
<!-- <div id="nav-main"> <!-- <div id="nav-main">
<div id="art-logo"></div> <div id="art-logo"></div>
</div> </div>

View File

@@ -25,6 +25,15 @@
<link rel="stylesheet" type="text/css" href="../css/Customers/MasterpageCustomers.css"/> <link rel="stylesheet" type="text/css" href="../css/Customers/MasterpageCustomers.css"/>
<link rel="stylesheet" type="text/css" href="../css/navbarsidebar2.css"/> <link rel="stylesheet" type="text/css" href="../css/navbarsidebar2.css"/>
<link rel="stylesheet" type="text/css" href="../css/Customers/CustomsAVISO.css"/> <link rel="stylesheet" type="text/css" href="../css/Customers/CustomsAVISO.css"/>
<script language='javascript'>
window.addEventListener('beforeunload', (event) => {
// Cancel the event as stated by the standard.
event.preventDefault();
// Chrome requires returnValue to be set.
event.returnValue = '';
});
</script>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
@@ -382,4 +391,6 @@
}); });
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -16,6 +16,7 @@ Partial Class CustomsAviso
Dim ckd As Integer = -1 Dim ckd As Integer = -1
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Page.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms Page.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms
If Me.Page.User.Identity.IsAuthenticated Then If Me.Page.User.Identity.IsAuthenticated Then
Try Try
Kdnrtext = Session.Item("CustomerID") Kdnrtext = Session.Item("CustomerID")
@@ -24,7 +25,14 @@ Partial Class CustomsAviso
End Try End Try
DataBind() DataBind()
Dim csm1 As ClientScriptManager = Page.ClientScript
Dim cstype As Type = Page.GetType
If Not csm1.IsStartupScriptRegistered(cstype, "Startup") Then
Dim string1 As String = "<script language=\""JavaScript\"">"
string1 += "</"
string1 += "script>"
csm1.RegisterClientScriptBlock(cstype, "Startup", string1)
End If
tbl_Header_row.TableSection = TableRowSection.TableHeader tbl_Header_row.TableSection = TableRowSection.TableHeader
' MsgBox(datebis) ' MsgBox(datebis)