Dear Sir
I want validate my asp.net C# form validation using jqury. But it's not working while using Master Page.
While Click on Submit no Message is reflecting.
<%@ Page Title="" Language="C#" MasterPageFile="~/MenueMaster.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" >
<script>
$(document).ready(function () {
$('#BtnSbmt').click(function () {
if ($('#ddldiv').val() == "") {
toastr.error('Please Select a Divison !');
$('#ddldiv').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlCrpo').val() == "") {
toastr.error('Please Select a Corporate !');
$('#ddlCrpo').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlRegn').val() == "") {
toastr.error('Please Select a Region !');
$('#ddlRegn').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlCntr').val() == "") {
toastr.error('Please Select a Controlling !');
$('#ddlCntr').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlBranch').val() == "") {
toastr.error('Please Select a Branch !');
$('#ddlBranch').css('border', '1px solid #a94442');
return false;
}
if ($('#txtUserCode').val() == "" || $('#txtUserCode').val().length < 4) {
toastr.error('Please enter User Code with minimum 3 Character !');
$('#txtUserCode').css('border', '1px solid #a94442');
return false;
}
if ($('#txtUserName').val() == "") {
toastr.error('Please enter User Name !');
$('#txtUserName').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlDept').val() == "") {
toastr.error('Please Select a Department !');
$('#ddlDept').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlDesg').val() == "") {
toastr.error('Please Select Designation !');
$('#ddlDesg').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlFunctn').val() == "") {
toastr.error('Please Select a Function !');
$('#ddlFunctn').css('border', '1px solid #a94442');
return false;
}
if ($('#txtMobileNumber').val() == "" || $('#txtMobileNumber').val().length < 10) {
toastr.error('Please enter 10 digit Mobile Number !');
$('#txtMobileNumber').css('border', '1px solid #a94442');
return false;
}
if ($('#txtAdharNo').val() == "" || $('#txtAdharNo').val().length < 12) {
toastr.error('Please enter 12 digit Adhar Number !');
$('#txtAdharNo').css('border', '1px solid #a94442');
return false;
}
if ($('#txtPanNumber').val() == "" || $('#txtPanNumber').val().length < 10) {
toastr.error('Please enter 10 digit Pan Number !');
$('#txtPanNumber').css('border', '1px solid #a94442');
return false;
}
if ($('#txtBankAccountNo').val() == "") {
toastr.error('Please enter Bank Account Number!');
$('#txtBankAccountNo').css('border', '1px solid #a94442');
return false;
}
if ($('#txtIFSCCode').val() == "") {
toastr.error('Please enter IFSC Account Number!');
$('#txtIFSCCode').css('border', '1px solid #a94442');
return false;
}
if ($('#ddlBankName').val() == "") {
toastr.error('Please enter Bank Number!');
$('#ddlBankName').css('border', '1px solid #a94442');
return false;
}
if ($('#txtEmailId').val() == "") {
toastr.warning('Please enter Email id !');
$('#txtEmailId').css('border', '1px solid #a94442');
return false;
}
if ($('input[name="rboActive"]:checked').length === 0) {
toastr.warning('Please Select Active Flag !');
$('#rboActive').css('border', '1px solid #a94442');
return false;
}
if ($('#rboActive').val() == "N" && $('#txtValidTo').val() == "") {
toastr.warning('Plese Enter Valid To Date !');
$('#rboActive').css('border', '1px solid #a94442');
return false;
}
else {
$('#ConfirmModal').modal('show');
}
});
});
</script>