I have a website that contains an email address. I have a webpage that is getting email id. Now I have to send the email id to the web service using ajax. How can I do this? The code below is placed at aspx page.
<script type="text/javascript">
$(".submit-btn").click(function () {
var _Email = document.getElementById('txtemail').value;
alert(_Email);
$.ajax({
url: "service/orderit.asmx/SendEmail",
data: {_email:_Email}
});
//PageMethod("/service/orderit.asmx/SendEmail", ['_email', _Email])
});
The code below is in the web service.
public json_helper.GenericJS SendEmail(string _email)
{
json_helper.GenericJS retval = new json_helper.GenericJS();
return retval;
}
This web service is in service folder and the page name is orderit.asmx.
Please help.