Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How to call sharepoint webpart usercontrol method in AJAX

$.ajax({

                type: "POST",
                url: "FundUserRegister2.asmx\validateEmail",

                data: "{'strMailID': '" + $('#<%= txtEmail.ClientID %>').val() + "'}",

                contentType: "application/json; charset=utf-8",

                dataType: "json",

                success: function (message) {


                    alert(message.d);

                }, error: function (message) {


                    alert(message.d);
                }
            });      

method is as following

[WebMethod]
        public static string validateEmail(string strMailID)
        {

            if (string.IsNullOrEmpty(strMailID))
            {
                string pwdRandom = DateTime.Now.ToString("htffffsH");

                MembershipCreateStatus status;
                MembershipUser newUser = Membership.CreateUser(strMailID, pwdRandom, strMailID, null, null, false, out status);
                if (status == MembershipCreateStatus.Success)
                    return "true";
                else
                    return "false";
            }
            else
            {
                return "false";
            }
share|improve this question
    
0% accept rate. Can you please mark your other questions with accepted answers? Thanks! See here: sharepoint.stackexchange.com/about –  Mike Jan 17 '13 at 17:45
    
May I know why you want to get user control in ajax –  SharePointer Jan 17 '13 at 20:43
    
to check dynamically weather user exist in database –  raky Jan 17 '13 at 21:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.