daredevil
daredevil

Reputation: 127

Client side validation issue on partial view

I am working on client side validation on partial view. I am trying to render jaqueryval bundle on master page but its not working.

@Scripts.Render("~/bundles/jqueryval")

In case same bundle render on partial view it works.

I would like to know how I can achieve the same, any small inputs on the same is also greatly appreciated.

Thanks in advance.

Upvotes: 0

Views: 1277

Answers (1)

Ashiquzzaman
Ashiquzzaman

Reputation: 5284

First add @Scripts.Render("~/bundles/jqueryval") in your _Layout.cshtml and after that add

$(function () {        
        $(document).ajaxComplete(function () {
            $.validator.unobtrusive.parse(document);
        });
    });

for parsing the unobtrusive attributes when we get content via ajax.

Upvotes: 3

Related Questions