Creating a C# object in javascript
<p>I'm trying to submit data to a web service in my project. The data's in the form of several fields, so I'd rather create a single object and submit that. I know I can submit it as a JSON object, but I thought I'd seen code somewhere that would create a C# object on the JS side so that I could submit it to the web service.</p>

<p>Am I crazy, or what does this JS code look like?</p>

<p>Just to get everyone on the same page example-wise, let's say the C# class would look like this:</p>

<pre><code>namespace NSTest
{
  [Serializable]
  public class ClassTest
  {
    public string ClassName;
    public int ClassValue;
  }
}
</code></pre>

<p>And the web service would look like this:</p>

<pre><code>namespace NSTest
{
  public class WebServiceTest
  {
    [WebMethod]
    public void WSFunc(ClassTest test)
    {
      ...
    }
  }
}
</code></pre>
