0

I have created a function in javascript like a class

 function myclass
{
this.Id=null;
this.Name=null;
}

from other function i am returning a list(Array in javascript) of myclass

function ReturnList
{
   var lst=[];
   var objmyclass=new myclass();
   objmyclass.Id=1;
objmyclass.Name="abc";

var objmyclass1=new myclass();
   objmyclass1.Id=1;
objmyclass1.Name="abc";

lst.push(objmyclass);
lst.push(objmyclass1);

PageMethods.GetListData(lst,onsuccess);

return false;
}

How do i read the lst in my webmethod

[WebMethod()]
public static bool GetListData(datatype lst)
{
   //How to read each item from lst
}

1 Answer 1

1

I would be tempted to look at MSDN's ASP .NET JSON article http://msdn.microsoft.com/en-us/library/bb299886.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.