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
235
Cancel ToolBar click event in BeforeRowInsert client side event
posted

I have a pege with a web tool bar and ultrawebgrid.

i am using  click for toolbar and BeforeRowinsert for webgrid clientside events.

I perform  some validations in the before row insert event.

when i enter wrong data and click a button on the toolbar ..the before row insert event performs the validation.

I want to stop the postback if a validation fails in the before row insert event (The tool bar click event).

Can u pls tell me how can i do it.  

Parents
No Data
Reply
  • 7694
    posted

    Hello,

    You can cancel client side event  BeforeRowInsertHandler with return true.Please take a look at the code below:
        <script type="text/javascript">

            function Insert(a, b, c) {
                if (validation == false) {
                    // cancel adding
                    return true;
                } else {
                    // allow adding
                    return false;
                }
            }
            
        </script>

    Hope this helps.

Children