Hi,
I am opening a page to add some document data through a window, and i need to popup the alert "Are you sure want to leave this page?" when ever the user close this window or moves the cursor away from the window or clicks anywhere else other than window. Can you please help me how to show this alert message?
1.This window opens up by clicking the sub menu items from the menu items list.
2. I want to show this alert only when i click the Add menu item -> Submenu items
3.I should not show the alert when i click Replace or any other menu items in that menu list.
4. Onemore thing this page already has the below Alert function and it is working fine when I am opening the same page in different location in a normal way but not in window mode.
I have called the alert function in OnClientItemClicked but i dont want this alert to be displayed when other menu items are clicked.
Thanks
Joselina
I am opening a page to add some document data through a window, and i need to popup the alert "Are you sure want to leave this page?" when ever the user close this window or moves the cursor away from the window or clicks anywhere else other than window. Can you please help me how to show this alert message?
1.This window opens up by clicking the sub menu items from the menu items list.
2. I want to show this alert only when i click the Add menu item -> Submenu items
3.I should not show the alert when i click Replace or any other menu items in that menu list.
4. Onemore thing this page already has the below Alert function and it is working fine when I am opening the same page in different location in a normal way but not in window mode.
This is the Javascript Function for the Alert
function windowOnBeforeUnload() {
if (window.event)
window.event.returnValue = 'You will lose any unsaved changes!'; // IE
else
return 'You will lose any unsaved changes!'; // FX
}
This is the RadMenu HTML code
<
table
class
=
"takeActionTableContainer"
cellpadding
=
"1"
cellspacing
=
"0"
style
=
"margin: 0 auto;"
>
<
tr
>
<
td
style
=
"vertical-align:top; text-align:center; width:50%"
>
<
telerik:RadMenu
ID
=
"RadMenuLibrary"
runat
=
"server"
EnableRoundedCorners
=
"true"
EnableShadows
=
"true"
Skin
=
"Default"
EnableTextHTMLEncoding
=
"true"
Width
=
"100%"
style
=
"z-index:10; position: relative; margin: 0; text-align:center;"
DefaultClickToOpen
=
"False"
CollapseDelay
=
"200"
ExpandDelay
=
"200"
OnClientItemClicked
=
"OnTakeActionItemClicked"
OnClientItemClosed
=
"windowOnBeforeUnload"
OnClientMouseOut
=
"windowOnBeforeUnload"
>
<
ExpandAnimation
Type
=
"None"
Duration
=
"200"
/>
<
CollapseAnimation
Type
=
"None"
Duration
=
"200"
/>
<
Items
>
<
telerik:RadMenuItem
runat
=
"server"
Text
=
"LIBRARY"
PostBack
=
"false"
Width
=
"100%"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
</
td
>
<
td
style
=
"vertical-align:top; text-align:center; width:50%"
>
<
telerik:RadMenu
ID
=
"RadMenuCollaborator"
runat
=
"server"
EnableRoundedCorners
=
"true"
EnableShadows
=
"true"
Skin
=
"Default"
EnableTextHTMLEncoding
=
"true"
Width
=
"100%"
style
=
"z-index:10; position: relative; margin: 0; text-align:center;"
DefaultClickToOpen
=
"False"
CollapseDelay
=
"200"
ExpandDelay
=
"200"
OnClientItemClicked
=
"OnTakeActionItemClicked"
>
<
ExpandAnimation
Type
=
"None"
Duration
=
"200"
/>
<
CollapseAnimation
Type
=
"None"
Duration
=
"200"
/>
<
Items
>
<
telerik:RadMenuItem
runat
=
"server"
Text
=
"COLLABORATOR"
PostBack
=
"false"
Width
=
"100%"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
</
td
>
</
tr
>
I have called the alert function in OnClientItemClicked but i dont want this alert to be displayed when other menu items are clicked.
Thanks
Joselina