Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 861001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:54:27+00:00 2026-05-15T08:54:27+00:00

I built contact form in aspx 3.5 and I’m using jQuery to send it

  • 0

I built contact form in aspx 3.5 and I’m using jQuery to send it to web service (asmx).

The web service need to return success or error code. The problem is that at the web method I get only single value and not array. I’m kind of new in ajax and I tried a lot of solutions but without any results. Please if you can only explain me the principle of what to do it also be good.

This is the client side:

$(document).ready(function() 
{
    $("#submit").click(function(event)
    {
        $.ajax
        ({
            type: "POST",
            url: "RVContactFormMailer.asmx/HelloToYou",                
            data: "{'name': '" + $('#name').val() + "', 'company':'" + $('#company').val() + "', 'phone':'" + $('#phone').val() + "', 'email':'" + $('#email').val() + "', 'questions':'" + $('#questions').val() + "'}" ,                 
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(msg) {
            AjaxSucceeded(msg);
         }, error: AjaxFailed
        });
   });

In firebug its sends correctly:

{'name': 'jhon', 'company':'example', 'phone':'123', 'email':'jhon@jhon.com', 'questions':'hello'}

The asmx code is (please ignore the names, its example:

  [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService] // To allow this Web Service to be called from script, using ASP.NET AJAX or JQuery.
    [ToolboxItem(false)]
    public class RVContactFormMailer : System.Web.Services.WebService
    {
        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]  
        public string HelloToYou(string name)
        {
            return "Hello " + name;
        }
    }

When I debug I see that the input parameter “name” contains only one string – I don’t know how to get the full json string that I send to the service and contains all the form data – I want to desirialize it to string array or something like, and process it.
how can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:54:28+00:00Added an answer on May 15, 2026 at 8:54 am

    the problem was not in the client side – it was in the server side – the problem is that i send few parameters to the web service but the function get only one:

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string HelloToYou(string name)
    

    while the correct one should be:

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string HelloToYou(string name, string company, string phone, string email, string questions)
    

    anyway, Thanks for the help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I built a template-based document generator using the Open XML SDK (1.0) , the
Which built in (if any) tool can I use to determine the allocation unit
We built a grant application system for a client. They've now asked for some
I built an application which displays the records from database in the window and
The built-in Math.Pow() function in .NET raises a double base to a double exponent
I built a Winform app several months ago that schedules appointments for repair techs.
Does C# have built-in support for parsing strings of page numbers? By page numbers,
I have a custom built ajax [div] based dynamic dropdown. I have an [input]
I have built an MSI that I would like to deploy, and update frequently.
Is there a built-in function/method that can check if a given string is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.