I just created a RadContextMenu that has the following items:
Insert
Edit
Delete
the menu has the following properties:
- server side event handler as a handler for the context menu item click event.
-Enable postback.
becuase i created this menu as a context menu for a RadGrid Control I need to create a client side Confirm message when the user click the delete item.
I do the following in the page load event
GridMenu.Items[2].Attributes.Add(
"onclick","return ConfirmDelete()");
where GridMenu is my RadContextMenu ID.
this is the client side java script code for the ConfirmDelete() function
function ConfirmDelete()
{
result=confirm(
"Delete?");
if (result==true)
return true;
else
return false;
}
the senario: when I click the Delete menu item it really pop up the Confirm message but
either i clicked Ok or Cancel It do postback
what really I need do the postback only when the user click ok,if not no postback occurs.
so please provide me with the help
Note: i'm using RadControls for Asp.net AJAX 2008-Q2.