I would suggest that you use a _javascript_ object on the server side and a Class on the server server.  Your call would then look like this
 
function MyMethod_Post()
{
   var oForm = new Object()
   oForm.Field1 = document.getElementById("formField1").value;
   oForm.Field2 = document.getElementById("formField2").value;
   Namespace.PageName.SaveForm(oForm, SaveForm_Callback);
 
}
 
function SaveForm_Callback(response)
{
   // process the response
}
 
 
C#
 
[AjaxPro.AjaxMethod()]
public string SaveForm (MyClass oClass)
{
   oClass.Field1 ...
 
}
 
Joseph Guadagno
http://josephguadagno.net/
 
On 6/13/06, MPiccinato <[EMAIL PROTECTED]> wrote:

Hello All,

I have been browsing around to try and find the answer to this but I am
not having much luck, so I thought I would ask.

I have a form with a bunch of fields that I want to submit back to the
server.  What is the best way of passing these fields back?  I was
thinking an array or an object.  I would like to be able to reference
them on the server something like

MyObject["txtFirstName"]

However, when I create an object on the client and pass it to the
server that has the function:

public void MyClass(object MyObject)
{
}

I get a nice long string of some Ajax NewDictionary type. Am I just not
understanding something about how to pass information back to the
server?

Thanks for any input!

-Mat






--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to