This is a migrated thread and some comments may be shown as answers.

Rad Context Menu PostBack

3 Answers 203 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Moustafa
Top achievements
Rank 1
Moustafa asked on 01 Aug 2008, 05:11 PM

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.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Aug 2008, 09:51 AM
Hello Moustafa,

Please, use the approach from this KB article and let us know if you have any further questions.


Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Moustafa
Top achievements
Rank 1
answered on 02 Aug 2008, 09:54 AM
Thank you very much

this solvee my problem
0
senthil
Top achievements
Rank 1
answered on 03 Dec 2008, 03:14 PM
can u tell how do that pls? I also have the same problem even I click the cancel button it goes to server side?pls help
Tags
Menu
Asked by
Moustafa
Top achievements
Rank 1
Answers by
Peter
Telerik team
Moustafa
Top achievements
Rank 1
senthil
Top achievements
Rank 1
Share this question
or