Hai all i wrote this for calling rmail is exists or not in my db
$(document).ready(function () {
function NameChecking() {
var name= $("#<%=TxtName.ClientID%>").value;
alert(name)
$.ajax({
type: "POST",
url: "Default.aspx/CheckEmail",
data: '{Name: "' + $("#<%=TxtName.ClientID%>")[0].value + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response);
}
});
}
and mmy .cs file is
[System.Web.Services.WebMethod]
public static string CheckEmail(string Name)
{
string s = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
string result = "";
SqlConnection con = new SqlConnection(s);
SqlCommand cmd = new SqlCommand("SP_CheckName", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Name", Name);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
result = "true";
}
else
{
result = "false";
}
return result;
but the method namechecking is not firing which is in textbox control
any leads..
TIA
Abhishek KumarPosted Jun 14, 2016, 2:14 AM
aditya immadiPosted Jun 14, 2016, 1:09 AM
Vinay SinghPosted Jun 13, 2016, 4:24 AM
aditya immadiPosted Jun 13, 2016, 3:33 AM