SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error on my sharepoint web application (I'm calling my own web method through ajax on my own user control) while accessing it from another computer and I'm getting this error: “{“Message”:”There was an error processing the request.”,”StackTrace”:”",”ExceptionType”:”"}”

I've read that I need to install ASP.NET AJAX 1.0 on my MOSS 2007 Server to get this to work. Is it true?



Here's my ajax call:

var Item = {
            emailSubject: jEmailSubject,
            emailBody: jEmailBody,
            userName: jUserName

            type: "POST",
            url: "/_layouts/WebPartPages/qadrs-webservicepage.aspx/SendEmailToAdmin",
            data: JSON.stringify(Item),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            error: function(error) {
                return false;
            success: function(response) {
                if (response.d == "Success") {
                    alert('Email Sent to Administrator');
                    $('#<%=txbEmailSubject.ClientID %>').val('');
                    $('#<%=txtbEmailBody.ClientID %>').val('');
                    window.location = $('#<%=hdnUrlReferrer.ClientID %>').val();
                else if (response.d == "NoEmailAddress") {
                    alert('No email address defined for admin users / user group admin is not configured in web config file. Email not sent.');
                    return false;
                else if (response.d == "Error") {
                    alert('Error while trying to send email to admin.');
                    return false;

My Web Method:

public string SendEmailToAdmin(string subject, string body, string userName, int groupId)
            string returnMessage = string.Empty;
            string adminEmailAddresses = string.Empty;
            int rowCounter = 0;
            string fromEmail = string.Empty;
            string fromName = string.Empty;

            DataSet ds = UserDAL.GetInstance().GetAllUserEmailByUserGroupId(groupId, Common.GetInstance().StripDomain(userName), ConnectionString(""));

                foreach (DataRow item in ds.Tables[0].Rows)
                    fromEmail = item["user_email_address"].ToString();
                    fromName = item["user_title"].ToString();

                foreach (DataRow item in ds.Tables[1].Rows)
                    if (rowCounter == 0) adminEmailAddresses += item["user_email_address"].ToString();
                    else adminEmailAddresses += "," + item["user_email_address"].ToString();

                if (rowCounter == 0) returnMessage = "NoEmailAddress";
                    MailMessage mail = new MailMessage();
                    mail.From = new MailAddress(fromEmail, fromName);
                    mail.IsBodyHtml = true;
                    mail.Subject = subject;

                    string newBody = string.Empty;

                    newBody += "<html><head></head><body>" + body.Replace("\n", "<br />") + "</body></html>";
                    mail.Body = newBody;

                        SmtpClient mailClient = new SmtpClient();
                        returnMessage = "Success";
                    catch (Exception ex)
                        returnMessage = "Error";
                        throw ex;
            catch (Exception exc)


            return returnMessage;
share|improve this question

If you are using pure jQuery to hit your web service, there is no need to install ASP.NET Ajax. But if you are using ASP.NET Ajax functionality(like Sys.Net.WebRequest(), or an UpdatePanel, for example), then yes, you do need to install it, because MOSS runs on .NET 2.0, which does not include it.

Having said that, it's impossible to tell what is going on in your case based on what you've said. If you would post some code and indicate where the error is being thrown, that would greatly increase your chances of getting a resolution.

share|improve this answer

You actually need to configure SharePoint 2007 to use .NET Framework 3.5 which is not in use by default. Doing that would enabled you full access to all the goodies.

There are many ways to enable the assembly redirection one being to open the location of the WSS Web Application via Visual Studio and change framework to 3.5 which would add proper entries. Alternatives see here, also Tobias Zimmerman has some but also here

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.