none
Jquery doesn't work in View after posting a Json data in MVC3 RRS feed

  • Question

  • I have a jquery written in view which works perfectly fine once view is loaded. After that I am posting a json data to my view if someone selects different record from the grid. There is no issue in getting Json data but the same jquery doesn't work there.

       

    <script type="text/javascript">
        $(function () {
            $('.lnkpendPayment').click(function () {

                var pendPayment = $("#pendingPaymentcntrol").val();

                if (pendPayment != null) {
                    $("#ViewPendingPayment").slideToggle(100);
                }
                else {
                    $("#NoPendingPayment").slideToggle(100);
                }
                return false;
            });
        });

    </script>

    <div id="viewpendinglink">
         <a href=""class ="lnkpendPayment" style ="text-decoration: underline; position : absolute; left : 55%; top:15px;" > View  </a>
     </div>

    So after JSON data is passed , if I click on the link , full refresh happens. 


    NV

    Thursday, September 19, 2013 10:50 PM

Answers

  • Hi,

    This forums is used for the WCF, Serialization, and Networking. It will be better if you post your question in the MVC forums, and in here you will get a good reply from the MVC experts.

    #MVC Forums:
    http://forums.asp.net/1146.aspx/1?MVC .

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Friday, September 20, 2013 2:11 AM
    Moderator