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 8142429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:49:14+00:00 2026-06-06T12:49:14+00:00

function s() { data = 192,273,182,347,13,34,52,2524; var jsondata = $.toJSON(data); $.ajax({ type: POST, url:

  • 0
function s() {
    data = "192,273,182,347,13,34,52,2524";
    var jsondata = $.toJSON(data);
    $.ajax({
        type: "POST",
        url: "index.aspx/s",
        data: jsondata,
        contentType: "application/json; charset=utf-8",
        dataType: "text json",
        beforeSend: function (xhr) {
            xhr.setRequestHeader("Content-type",
                         "application/json; charset=utf-8");
        },
        success: function (msg) {
            if (msg.d == "OK") {
                //WIN!
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            if (typeof (errorThown) != "undefined")
                alert("ERROR: SaveWidgetSettings() " + textStatus + '\n' + errorThrown);
            else {
                var errdetail = eval("(" + XMLHttpRequest.responseText + ")");
                alert("ERROR: SaveWidgetSettings() " + textStatus + '\n' + errdetail.Message);
            }
        }

    });

I debugged the issue to:

cannot convert object of type 'system.string' to type 'system.collections.generic.idictionary 2 system.string system.object '

are the commas messing up the string?

  • 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-06-06T12:49:15+00:00Added an answer on June 6, 2026 at 12:49 pm

    You may need to wrap the value in an object before serializing so ASP.NET knows what the value is called:

    data = { csv: "192,273,182,347,13,34,52,2524" };
    

    ASP.NET often uses key names to determine which argument to assign a value to (assuming WebMethod with the URL being index.aspx/s):

    [WebMethod]
    public static object s(string csv) ...
    

    Also, if the goal is a collection, data can also be an Array:

    data = { ids: [192, 273, 182, 347, 13, 34, 52, 2524] };
    
    // then...
    [WebMethod]
    public static object s(IEnumerable<int> ids) ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data)
jQuery code: function ajaxsubmit(){ $.ajax({ url: /update, type: POST, dataType: html }).success(function(data) { $('#result').html(data);
function checkSession(){ $.ajax({url: session.php, success: function(data){ if( data == 1){ var postFilen = 'msg.php';
$(document).ready(function() { $('#content').html(''); $.ajax({ url:'data.json', dataType: json, success: function(data) { $('#content').append('<p>'+data.rank+'</p>'); } });}); In
I wrote this code: function json() { var url=http://192.172.2.23:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=json&typeName=topp:networkcoverage&CQL_FILTER= topp:CELL_ID='410-07-301-31781' Or topp:CELL_ID='nnn'&callback=?; jQuery.getJSON(url,function(data){alert(Symbol: +
function getHtmlBodyFromFile( filename ){ var outStr = ''; $.get(filename, function(data, status) { outStr =
I have the following ajax function: function ajax(value, url, urlVarname, displayContainers_id){ if(value == ''){
I am trying to post the data usign $.ajax, but I am getting failure
I am having problem with xmlparsing with post method. API URL : http://XXX.XXX.X.XX/api/user.php Function
Here is my code $ .ajax({ cache : false, type : 'POST',//While GET working

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.