woohoo.. passing complex types to JS with Atlas is working! but is this the only way?

S

sonic

i am happy to report that serializing complex types into javascript and
passing it back to the server is effortless with atlas.

1. Create JavaScriptConverter
MyTypeJavaScriptConverter : JavaScriptConverter
you dont even have to override serialize/deserialize
this part appears to be taken care of automatically by
JavaScriptObjectSerializer static class
2. Create a WebMethod to pass back your type
public MyType CreateType() { return new MyType(); }
3. now you can call it from js using fully qualified name
Co.BusinessObject.MyWebService.createType( callbackFunc)
and you've got an instance.
4. use the instance to call anotehr webmethod that uses MyType as input
param.

my question is..
is calling a webservice the only way of creating an instance of MyType
on client?

for example, with available converters such as datatable / dataset.. is
it possible to create it on client w/out webservice call?
var ds = new DataTable(); etc...
 
S

sonic

3. now you can call it from js using fully qualified name
Co.BusinessObject.MyWebService.createType( callbackFunc)
and you've got an instance.

my question is..
is calling a webservice the only way of creating an instance of MyType
on client?

for example, with available converters such as datatable / dataset.. is
it possible to create it on client w/out webservice call?
var ds = new DataTable(); etc...

ok.. it looks like simply stating..
new co.business.MyObject();
works and is acceptable by the web method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top