Hi,
you can use AjaxPro.JavaScriptObject as type for your .NET AjaxMethod:
[AjaxPro.AjaxMethod]
public static string MyMethod(AjaxPro.JavaScriptObject o)
{
return o["firstname"].ToString();
}
On the client you use this code:
var o={};
o.firstname = "Michael";
MyClass.MyMethod(o, callback);
Other types you can use are NameValueCollection or a StringDictionary,
IDictionary.
Maybe you want to have a look at
http://munich.schwarz-interactive.de/feedback.aspx (see feedback.js).
You can get the source at http://www.codeplex.com/.
Regards,
Michael
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
>
>
> >
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---