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 Sergey Alexandrovich Kryukov 545
1 OriginalGriff 285
2 Shweta N Mishra 244
3 BillWoodruff 230
4 Mathew Soji 225
0 OriginalGriff 6,153
1 Sergey Alexandrovich Kryukov 5,758
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,735


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.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