Actually in ur code for client side function :
function ShowAvailability() {
$.ajax({
type: "POST",
url: "CS.aspx/CheckUserName",
data: '{userName: "' + $("#<%=txtUserName.ClientID%>")[0].value + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function(response) {
alert(response);
}
});
}
you mentioned url .. how to handle this from master page.. as it is common for all pages.
i want to put this code you mentioned in example at masterpage.