Aug 13, 2009, 4:02 AM
Send complex object to AjaxMethod
Hi,
I just wanted to know if it was possible to pass a complex object to an AjaxMethod.
I am first retreiving a complex object from an AjaxMethod and then passing it to another one. I have put it all into one class and for ease of explanation have ripped out most of the code.
eg.
I just wanted to know if it was possible to pass a complex object to an AjaxMethod.
I am first retreiving a complex object from an AjaxMethod and then passing it to another one. I have put it all into one class and for ease of explanation have ripped out most of the code.
eg.
<ext:Button ID="btnSave" runat="server" Text="Finish">
<Listeners>
<Click Handler="getData();" />
</Listeners>
</ext:Button>
<script type="text/javascript">
function getData(){
Coolite.AjaxMethods.GetData({success:loadData});
}
function loadData(result){
Coolite.AjaxMethods.LoadData(result);
}
</script>
CodeBehind
[AjaxMethod]
public TestData GetData()
{
TestData td = new TestData();
td.ID = 1;
td.Value = "Value";
return td;
}
[AjaxMethod]
public void LoadData(TestData td)
{
}