I want to do this type of validation using javascript on text box in asp.net on textchange event of text box below is my code in c# validtaion:
string str = "Select ReceiptNo from BranchOutwardItems where ReceiptNo='" + txtReceiptNo.Text + "'";
DataTable dt = objGlobalClass.LoadData(str);
if (dt.Rows.Count > 0)
{
lblMsg.Text = " Receipt ID already exists.Click On ADD for Generate New Receipt ID";
}
else
{
lblMsg.Text = "Receipt ID doesnot exists";
}