Mar 17, 2011 at 5:54 AM

Does anyone have any suggestions on how to suppress the postback event on a client click event?

I have a context menu i have created from code and have a statement  ItemColumnSelector.ClientClick = "Item_ColumnSelector_Click" which seems to fire when clicked but is not running the javascript on the page as I suspect the page is posting back and thus does not yet exist.

Alternatlvely if there are examples of how to correctly apply the ClientClick property, answers on a postcard...

Many thanks, Ken.

Mar 17, 2011 at 7:52 AM


you can cancel page postback this way :

MyItem.ClientClick = "MyFunction(); return false;"




Mar 17, 2011 at 8:01 AM


Thanks that worked first time, looking at it now probably qualifies me for the dumb question of the week award! but thanks for your time never the less... ;-)