Hi indradeo,
Use Customvalidator for checking the condition.
HTML
Parking Amount:
<asp:TextBox ID="txtParkingAmount" runat="server"></asp:TextBox><br />
Grand Total:
<asp:TextBox ID="txtGrandTotal" runat="server"></asp:TextBox>
<br />
<asp:CustomValidator runat="server" ControlToValidate="txtGrandTotal" ClientValidationFunction="Validate"
ForeColor="Red" ErrorMessage="Grand Total Amount must be greater than 10 or equal to Parking Amount." />
<script type="text/javascript">
function Validate(sender, args) {
var parkingAmount = document.getElementById("txtParkingAmount").value;
var grandTotal = document.getElementById(sender.controltovalidate).value;
if (parkingAmount == "") {
if (parseInt(grandTotal) < 10) {
args.IsValid = false;
}
} else {
if (parseInt(grandTotal) != parseInt(parkingAmount)) {
args.IsValid = false;
}
}
}
Screenshot