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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:13:52+00:00 2026-06-03T14:13:52+00:00

var sc = new Array(); var i =0; el.find(.colorable).each(function () { sc[i++] = $(this).attr(src);

  • 0
var sc = new Array();
var i =0;
el.find(".colorable").each(function () {
    sc[i++] = $(this).attr("src");
});
$.post("/Edit/ChangeImageColor", { src : sc , s: source, t: target }, function () {
    alert("done");
});

I am trying to pass array ( sc ) to server but it shows null in src

    public JsonResult ChangeImageColor(string[] src, string s, string t)
    {

Can anybody tell me what i am missing?

  • 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-03T14:13:53+00:00Added an answer on June 3, 2026 at 2:13 pm

    If you are using ASP.NET MVC 3 you could send it as JSON request:

    var sc = new Array();
    var i = 0;
    el.find(".colorable").each(function () {
        sc[i++] = $(this).attr("src");
    });
    $.ajax({
        url: '/Edit/ChangeImageColor',
        type: 'POST',
        contentType: 'application/json',
        data: JSON.stringify({ src: sc, s: source, t: target }),
        success: function() {
            alert("done");
        }
    });
    

    If you are using an older version of ASP.NET MVC you may take a look at the following blog post which illustrates how you could integrate a custom json provider factory allowing you to send JSON requests to controller actions.

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

Sidebar

Related Questions

TheObject = { getArray: function(){ var groups = new Array; $.ajax({ type: "POST", url:
I have an array created with this code: var widthRange = new Array(); widthRange[46]
function populateGroups(){ var p =1; var groupNames = new Array(); $.ajax({ type: GET, url:
var Stars = new Array(1,2,3,4,5,6,7,8,9,10); var StarsX = new Array(451,455,460,470,490,100,160,220,280,300); var StarsY = new
var grossBrackets = new Array( '300', '400', '500', '600', '700', '800', '900', '1000' );
var pieceSize = new Array(); pieceSize[0] = 200; pieceSize[1] = 400; pieceSize[2] = 300;
Given var myHash = new Array(); myHash['key1'] = { Name: 'Object 1' }; myHash['key2']
Here is my code var inventory = new Array(); inventory[0] = Potion; inventory[1] =
I have an array in Javascript: var array = new array(); array[0] = apples;
Let's say I have an array var test = new Array() the values in

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.