USE [dbCoepdPlacements] GO GO CREATE Procedure [dbo].[ResumeSubmission_Validation] ( @CompanyName VARCHAR(100) = NULL ) AS BEGIN SET NOCOUNT ON SELECT COUNT(*) from tblResumeSubmission where CompanyName = @CompanyName and IsDeleted=0 SET NOCOUNT OFF END GO ========================================================================= clsResumeSubmissionData ============================ public int LoadResumeSubmissionValidation(clsResumeSubmission obj) { using (SqlConnection objConn = new SqlConnection(Constr)) { using (SqlCommand objCmd = new SqlCommand("ResumeSubmission_Validation", objConn)) { objConn.Open(); objCmd.CommandType = CommandType.StoredProcedure; objCmd.Parameters.AddWithValue("@CompanyName", obj.CompanyName); int count = Convert.ToInt16(objCmd.ExecuteScalar()); return count; } } } =========================================== clsResumeSubmission ================================= public int LoadResumeSubmissionValidation(clsResumeSubmission obj) { return DBLayer.LoadResumeSubmissionValidation(obj); } ============================================== ResumeSubmission.aspx ========================================== --------------------------------->put auto post back and on text change event ============================================= ResumeSubmission.aspx.cs =============================================== int CountNo = 0; -------------------------------------------->put this below the page load protected void BindCount() { clsResumeSubmission obj = new clsResumeSubmission(); obj.CompanyName = Convert.ToString(txtCompanyName.Text); CountNo = obj.LoadResumeSubmissionValidation(obj); if (CountNo > 0) { txtCompanyName.Text = ""; FormMessage.Visible = true; FormMessage.Text = "You Can enter the company Name Once "; ErrorMessage.Visible = false; btnSubmit.Enabled = false; } } protected void txtCompanyName_TextChanged(object sender, EventArgs e) { BindCount(); }