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
705
How to cancel a postback on node click event
posted

I have a 2 level webDataTree that I want to do some processing on the server when the user clicks on the child nodes.  However when they click on the parent node I don't want the postback to happen.

Is there a way to cancel the server side clicked event?  Can I do something like handle the client click and use that to abort?

The only real thing I need to ensure is that I send the node.tag data back to the server as that is the key for my logic to process.

Thanks

jack

Parents
No Data
Reply
  • 3726
    Verified Answer
    posted

    Hi,

    the WebDataTree has NodeClick event on the client side and on the server side. Of course the click events can not be canceled.  It's like you can't cancel a mouse click on your desktop - it just happens. The important thing is how do you process the click. So you can set Enabled = false to all parent nodes. This way the user will be able to expand/collapse the parents, but no events will be fired for those nodes.

    To my understanding you have configured autopost back on NodeClick and you do not want to go to the server when an unneeded node is clicked. You can disable autopostback and do manual postback when the right node has been clicked.

    Hope this helps.

    Thanks,

    Lubomir

Children