Wednesday, April 11, 2007

Code for JSON DataSet Deserialization in

My typed DataSet looks like this:

This method is in code behind

public static MyDS GetDataFromServer()
MyDS d = new MyDS();
d.MyTable.AddMyTableRow("1", "abc");
return d;


The following lines are from aspx page accessing the service:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true>
<asp:ServiceReference Path="Common\TestService.asmx" />

Given below is the javascript code:

<script type="text/javascript" language="javascript">

function OnLookupComplete(result, userContext)
//Accessing typed dataset using column names

function OnError(result)
alert("Error: " + result.get_message());
function init()
debugger; //start debugging


It is called on body.onload

<body onload="init();">

1 comment:

Nysa said...

Good for people to know.