You must Sign In to post a response.
  • Category: ASP.Net MVC

    Why not calling model data annotation in mvc

    Hi,
    I am trying to call data annotation in mvc. First i want check data annotation then call jquery validation for go next tab. I have tab each tab calling next button. so before next button press I want check data annotation validation, then check jquery validation to go for next tab.

    $(document).ready(function () {
    $('#btnNext').on('click', function (e) {
    var Valid = true;

    if ($('#ddlRoleUserID').val() != "" && $('#ddlPortUserID').val() != "" && $('#txtPAN').val() != "") {
    Valid = true;
    return true;
    }
    else {
    Valid = false;
    return false;
    }

    if (Valid == true)
    {
    $('.shipments-tabs > .active').next('li').find('a').trigger('click');
    $('.shipments-tabs > .active').prev('li').children('a').find('i').addClass('icon-done').removeClass('icon-in-progress');
    $('.shipments-tabs > .active').removeClass('disable-click').children('a').find('i').addClass('icon-in-progress').removeClass('icon-pending');
    }
    });
    });
  • #769797
    Hello Sir,
    Please check this blog this will help you to get solutions: https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/models-data/validation-with-the-data-annotation-validators-cs


  • Sign In to post your comments