Am calling a webservice from my jQuery to fetch both Staff and Student details. In my web service I have values for Staff as well as Students, and am returning these as array of strings. While returning values am just serializing these two as
[WebMethod(EnableSession = true)]
public string[] fetchStudentStaff(string sectionId)
{
string student;
string staff;
////
////
student = jsonSerialize.Serialize(studentList);
staff = jsonSerialize.Serialize(staffList);
return new string[] { student, staff };
}
here I've a variable called category for mentioning whether he is a staff or student. and am receiving this in my jQuery part as,
[
[
[
{
"Name": "shanish",
"StudentId": "12",
"Category": "Student",
"Mobile": "8147708287",
"Email": "[email protected]"
}
]
],
[
[
{
"Name": "shanish",
"StaffId": "78",
"Category": "Staff",
"Mobile": "8147708287",
"Email": "[email protected]"
}
]
]
]
here, I tried using jQuery.parseJSON(data.d) to group the result, but it results null, I need to categorize the result with student and staff, here I have one student and one staff, for the case of 5 student and 2 staffs, I need to store students in a separate variable and 2 staffs in a separate variable.
I dunno how to achieve this, can anyone help me here...Thanks in advance