Send Complex objects parameter ,always return null?

Mar 17, 2008 at 10:02 AM
Edited Mar 19, 2008 at 4:37 AM
Javascript:
----------------------
function test()
{
var abc = {Title:"kai.ma"};
SessionManager.Test(abc,function(x){
alert(x.Title)
});
}
----------------------

C#:
---------------------
//############Class1.cs##########
public class Class1
{
private string m_Title = string.Empty;

public virtual string Title
{
get { return m_Title; }
set { m_Title = value; }
}
}
//##########SessionManager.cs#####
public static Class1 Test(Class1 lb)
{ return lb; }
---------------------

dynAjaxConfig.xml
---------------------
...
<method name="Test" needAuth="false">
<param name="lb" type="IDictionary"/>
</method>
...
---------------------
Coordinator
Apr 2, 2008 at 9:45 PM
Hello,

I'm magicben, the DynAjax project leader.
Sorry, but you can only send these kinds of data as server method arguments:
- boolean
- string
- int
- long
- decimal
- IDictionary
- IList

Thus, you can't expose the method:
public static Class1 Test(Class1 lb) { return lb; }

please update it by:
public static Class1 Test(IDictionary lb) { return lb; }

Regards,
magicben - admin@dynajax.org
Apr 26, 2008 at 4:25 AM
Edited Apr 26, 2008 at 4:25 AM
I see.Thank you.