Please excuse me if the answer to this question is obvious or has been asked
before.

I did some searching prior to posting this and could not find an answer.



I would like to create an object in Javascript and pass it to a server-side
AjaxMethod

and in the server side method be able to access the data in it like it was
an object.



I have tried doing this:



<script>

function someFunction()

{

            var myObject = new Object();



            myObject.Value1 = "1";

            myObject.Value2 = "2";



            PageClassName.getSomeData(myObject);

}



[AjaxMethod]

public void getSomeData(object theObject)

{

            ...

            // I would like to be able to reference the data here like

            // theObject.Value1

}



When I use the debugger and place a break point in the AjaxMethod, the
object is their

but it appears to be one long string.



So I guess my question is how can I create a javascript object, pass it to a
server side

Ajax Method and use it like an object in the server side method ?



Thanks



David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/

The open source project is now located at 
http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro
-~----------~----~----~----~------~----~------~--~---

Reply via email to