Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1115
IE error in _navigateOnClick: function (openInNewWindow, modal)
posted

I have such code

<%@ Control Language="c#" AutoEventWireup="true" Inherits="Cyberbahn.Site.UserControl.Ss.SimpleServiceMenu" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" Codebehind="SimpleServiceMenu.ascx.cs" %>
<%@ Register TagPrefix="servicemenu" Namespace="Cyberbahn.Site.ServerControl" Assembly="Cyberbahn.Site" %>
<%@ Register TagPrefix="simplemenu" Namespace="Cyberbahn.Site.ServerControl" Assembly="Cyberbahn.Site" %>
<%@ Register Assembly="Infragistics35.Web.v12.2, Version=12.2.20122.1007, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.NavigationControls" TagPrefix="igtmenu" %>

<SCRIPT language="JavaScript" type="text/javascript">

var submit = false;

window.onbeforeunload = function (evt) {
var message = "Please note the data you have entered will not be saved if you exit prior to submitting your request. Click 'Ok' to exit or click 'Cancel' to remain on this page.";
var hdnTabActionState = document.getElementById('hdnTabActionState').value;
var ret = "";

if (hdnTabActionState != "7" && submit == false) // Submitted = 7
ret = message;

if (typeof evt == 'undefined') {
evt = window.event;
}
if (evt) {
if (ret != "") {
submit = true;
evt.returnValue = ret;
}
}
setTimeout('submit=false;', 1000);
if (ret != "")
return ret;
}

</script>

<servicemenu:aspservicemenu id="UltraWebMenu" ActivateOnHover="false" runat="server" GroupSettings-Orientation="Horizontal" itemwidthdefault="100px" borderwidth="0px"
CssClass="igdm_cb_ControlHorizontal" >
<Items>
<igtmenu:DataMenuItem NavigateUrl="/cyberbahn/Components/SecuritySearches/WebTab.aspx"
Text="$resource:SsService_Search" GroupSettings-Width="70px">

</igtmenu:DataMenuItem>
<igtmenu:DataMenuItem NavigateUrl="/cyberbahn/components/SecuritySearches/BundleList.aspx"
Text="$resource:SsService_BundleList" GroupSettings-Width="150px">

</igtmenu:DataMenuItem>
<igtmenu:DataMenuItem NavigateUrl="/cyberbahn/components/SecuritySearches/TransactionList.aspx?search=true"
Text="$resource:SsService_TransactionList" GroupSettings-Width="150px">

</igtmenu:DataMenuItem>
<igtmenu:DataMenuItem NavigateUrl="/cyberbahn/components/SecuritySearches/BundleListIG.aspx"
Text="Bundle List IG" GroupSettings-Width="150px">

</igtmenu:DataMenuItem>
<igtmenu:DataMenuItem NavigateUrl="/cyberbahn/components/SecuritySearches/TransactionListIG.aspx?search=true"
Text="Transaction List IG" GroupSettings-Width="150px">

</igtmenu:DataMenuItem>
</Items>
<ItemSettings CssClass="igdm_cb_MenuItemHorizontalRoot"
HoverCssClass="igdm_cb_MenuItemHorizontalRootHover"
SelectedCssClass="igdm_cb_MenuItemHorizontalRootSelected" />

</servicemenu:aspservicemenu>

So if I click on webMenuItem, browser create popup(popup.png)

When I click Stay on this page I got such error.

  • 29417
    Verified Answer
    Offline posted

    Hello Anton ,

     

    Thank you for posting in our forum.

     

    In general when you click on the menu it will try to navigate out of the page using:

    document.location.href= <some url>

     

    It seems that if you cancel the beforeunload event that will throw an error in IE. This is a known behavior in IE and it can be reproduced in a simple scenario as well.

    For example if you try to change the location via a button click but then cancel the beforeunload event.

     

    Instead of cancelling the onbeforeunload event you could handle the WebDataMenu’s click event and in it  check via a confirm whether to continue with the navigation or not. For example:

    function wdm_click(sender, e) {

                if (!confirm('Press OK to continue, or Cancel to stay on the current page.')) {

                    e.set_cancel(true);

     

                }

    Let me know if you have any questions or concerns.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer II

    Infragistics, Inc.

    http://es.infragistics.com/support