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

  • Home
  • SEARCH
  • 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 7646795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:17:59+00:00 2026-05-31T10:17:59+00:00

function sendStates(data) { var states = new Object(); states.Id = 1; states.Name = Chandan;

  • 0
function sendStates(data) {
    var states = new Object();
    states.Id = 1;
    states.Name = "Chandan";
    $.post("WebService.asmx/MultiDim/", states, function (data) {
        alert("reached");
    });
}

sendStates(null);

WebService file:

[WebMethod]
        public void MultiDim(statesTemplate states)
        {

        }

MultiDim function doesnt get called.

  • 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-31T10:18:01+00:00Added an answer on May 31, 2026 at 10:18 am

    Change:

    var states = new Object();
        states.Id = 1;
        states.Name = "Chandan";
    

    to

    var object = {states: {Id: 1, Name: "Chandan" }}
    $.post("WebService.asmx/MultiDim/", object, function (data) {
        alert("reached");
    });
    

    The method parameter name is needed. The object you send to .NET needs the method parameter name in order to parse your Request.


        [WebMethod]
        public void MultiDim(statesTemplate states /* must be the javascript name too */)
        {
    
        }
    

    jQuery doesn’t know that your object’s variable name is states. It is only an object with two properties Id and Name.

    So adding an object with a property states is the answer.

    var objectToSendToNet = new Object();
    objectToSendToNet.states = new Object();
    objectToSendToNet.states.Id = 1;
    objectToSendToNet.states.Name = "Chandan";
    
    $.post("WebService.asmx/MultiDim/", objectToSendToNet, function (data) {
        alert("reached");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function controllaFoto(target, username) { var _URL = window.URL || window.webkitURL; var img = new
function ff_chk_username_unique(element, action) { alert(element.value); alert(action); var actiona=http://localhost/myproject/check/check_username.php; var form_data = { username: element.value,
function initialize() { var myOptions = { center: new google.maps.LatLng(23.71181,90.407467), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP
function showContent(tableID) { var tbl = document.getElementById(tableID); var rCount = tbl.rows.length; try { alert(tbl.rows[rCount
function genTask(elem){ elem.each(function(){ $this=$(this).parent('.cntTasks'); var pattern=/taskId-(.*)$/ var idTask=$this.attr('id').match(pattern); var data='id_task='+idTask[1]; if(typeof jsVar2 !='undefined') data+=jsVar2;
function getsession(){ var data = $.get('../session', function(data) { return data; }); return data; }
function MyFunction() { closure = function() { alert('my parent function name is: '/* now
function check(id){ var _id = document.getElementById(id); url = test.php?check=1&id= + _id; } i want
function countChars(elm) { if (elm.nodeType == 3) { // TEXT_NODE return elm.nodeValue.length; } var
function example(){ var quantity = http://www.example.com/index.php?brandid=b%123&quantity=20; quantity = quantity.replace(-what regular expression should i user-,

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.