Data Annotations / Validation not working for partial views

后端 未结 2 449
时光取名叫无心
时光取名叫无心 2021-01-07 01:59

I have some partial views loaded at runtime, based on user input.

$(\"#Categories\").change(function () {
        $.ajax({
            url: \"/Product/Crea         


        
2条回答
  •  日久生厌
    2021-01-07 02:05

    Just Include JS files i.e Jquery Unobtrusive js file in your Partial View also then it work fine ,some times this problem comes in partial view in asp.net mvc.

    Just include this js file in your Partial View also :

    
    

    ------------------OR try this in Partial View--------------------------

    $.validator.unobtrusive.parse($("form"));
    

提交回复
热议问题