Hi All,
I'm new to this jquery and i found some article, implemented but its server side method is not firing. Plz if you know help out this probelm.
These is the code implemented in my application in jquery side.
<script type="text/javascript" ></script>
<script language="javascript">
$(document).ready(function() {
$("#btnClick").click(function() {
var email = $("#txtemail").val();
$.ajax({
type: "POST",
url: "TestingEmail.aspx/DNSValidation",
data: "{EmailAddress:" + email.toString() + "}",
success: function(response) {
alert(response.d);
// if (response.bolDNSFlag != "true") {
// alert("Plz try again");
// $("#txtemail").focus();
// }
},
error: function() {
alert("Error");
}
});
//Call the PageMethods
$.ajax(options);
});
});
</script>
and server side is
[WebMethod]
public static string DNSValidation(string EmailAddress)
{
Boolean bolDNSFlag = false;
try
{
if (isEmail(EmailAddress.Trim()))
{
string[] host = (EmailAddress.Trim().Split('@'));
string hostname = host[1];
IPHostEntry IPhst = Dns.GetHostEntry(hostname);
IPEndPoint endPt = new IPEndPoint(IPhst.AddressList[0], 25);
Socket s = new Socket(endPt.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
s.Connect(endPt);
bolDNSFlag = true;
}
}
catch (Exception exp)
{
bolDNSFlag = false;
}
return bolDNSFlag.ToString();
}
Im not geting the breakpoint. Plz let me know if u have any idea.