my Json code is
ListOrderDetails.push({ // Add Order Details to array
"OrderType": OrderType,
"CaseNumber": CaseNumber,
"OrderNumber": OrderNumber,
"OrderStatus": OrderStatus,
"Reason": Reason,
"Coments": Coments
});
var Params = { "Geo": Geography, "GeoId": GeographyID, "CountryCode": CountryCode, "Segment": Segment, "SubsegmentID": SubSegmentID, "OrderDetails": ListOrderDetails };
//var Params = { "Geo": Geography, "GeoId": GeographyID, "CountryCode": CountryCode, "Segment": Segment, "SubsegmentID": SubSegmentID };
$.ajax({
type: "POST",
url: "MyDataVer1.aspx/SaveManualEntry",
contentType: "application/json",
data: JSON.stringify(Params),
dataType: "json",
success: function(response) {
alert(response);
},
error: function(xhr, textStatus, errorThrown) {
alert("xhr : " + xhr);
alert("textStatus : " + textStatus);
alert("errorThrown " + errorThrown);
}
});
c# webmethod is
[WebMethod]
public static int SaveManualEntry(string Geo, int GeoId, string CountryCode,
string Segment, string SubsegmentID,
object[] OrderDetails)
{
try
{
int TotalOrderCount = 0;
int Successcount = 0;
return Successcount;
}
catch (Exception ex)
{
throw ex;
}
}
How to get values from the Object orderDetails. I cant use indexing.