Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using bootstrap for my asp.net application.
And for validating controls am using Formvalidation plugin.

It in not working after any post back.If I removed my update panel it is working fine.
How to makes it work properly with update panel also.

I tried the below code.


XML
<script type="text/javascript">
                    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(instance_initializeRequest);
                    function instance_initializeRequest(sender, args) {
                        if (!Test()) {
                            args.set_cancel(true);
                        }
                    }
                </script>





XML
<script type="text/javascript">
        function Test() {
            $(document).ready(function () {
                $('#defaultForm').formValidation({
                    message: 'This value is not valid',
                    icon: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        '<%=txtAresinSqft.UniqueID%>': {
                            validators: {
                                integer: {
                                    message: 'The input is not a valid phone number',
                                    country: 'IN'
                                },
                                notEmpty: {
                                    message: 'The phone number is required and can\'t be empty'
                                },
                            }
                        }

                    }
                });
            });
        }
    </script>




XML
<script type="text/javascript">
       
       Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Test);
   </script>




Now it is working fine . But one new problem came like no events are firing .

Please help .last 3 days I stucked in this problem.


Thank you
Subin ks
Posted
Comments
jaket-cp 5-Jun-15 4:17am    
try removing:
$(document).ready(function () {
and its closing }); from function Test()
Leave all the inside bits, and see if that works.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900