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?
If you are using ASP.NET MVC 3 you could send it as JSON request:
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.