Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: jQuery JSON
I am sending few data to Webservice.
===================================
function test() {
        var dataURL = "data:image/png;base64,iVBORw0KGgoAAAAN";
        var dataUrlJson = [{ "imageData": dataURL }];       
        $.ajax({
            type: "POST",
            url: "LP18WS.asmx/CreateMarkers",
            // The key needs to match your method's input parameter (case-sensitive).
            data: JSON.stringify({ Markers: dataUrlJson }),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) { alert(data); },
            failure: function (errMsg) {
                alert(errMsg);
            }
        });
===========================================
in LP18WS.asmx file
==================
public class Marker
        {
            string imageData { get; set; }            
        }
        
 
        [WebMethod]
        public string CreateMarkers(List<Marker> Markers)
        {
            foreach (Marker mk in Markers)
            {
              //string aa = mk.imageData//Error
            }
 
            return "Received " + Markers.Count + " markers.";
        }
============================================
Debugger is hitting and executing without any error.
 
But I am not able to read the data.
Can anyone tell me how to read the data (ie. Markers["imageData "])
Posted 26-Apr-13 7:40am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 275
1 Maciej Los 204
2 Sergey Alexandrovich Kryukov 200
3 King Fisher 185
4 OriginalGriff 183
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 26 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100