tags:

views:

13

answers:

0

I have some ajax fucntions on my default.aspx that I use for saving data to my db. I have the form on my web control. When I try calling the function from my button which resides on the web control. I get an error.

Any help?

function ShowAvailability() {
$.ajax({
    type: "POST",
    url: "Default.aspx/CheckEmail",
    data: '{usermail: "' + $("#<%=txtemail.ClientID%>")[0].value + '" }',
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: OnSuccess,
    failure: function(response) {
        alert(response);
    }
});

}

I need to call that function from my registerform.ascx. How do I do that from within the registerform code behind?