title: How to pass multiple values as single object in Javascript/Ajax
body: <p>I'm new to javascript and MVC  I'm working on a sample application containing a sign up page and I'm using ajax to done the process my current code is given below</p>
  
  <pre><code>  function create() {
          var user_name = $("#txtUser").val();
          var pass = $("#txtPass").val();
          var email = $("#txtEmail").val();
          var phone = $("#txtPhone").val();
          var city = $("#txtCity").val();
          var state = $("#txtState").val();
          var zip = $("#txtZip").val();
          $.ajax({
              url: '/EmberNew/Home/Create',
              type: 'POST',
              data: { user_name: user_name, pass: pass,email:email,phone:phone,city:city,state:state,zip:zip },
              success: function (response) {
                  alert("success");
              }
          });
          return false;
      }
  </code></pre>
  
  <p>and its working fine but I want to know that is there any way to pass these values as a single object like in C# forgive me if this question is too silly</p>
  
  <p>serverside code</p>
  
  <pre><code>[HttpPost]
  public ActionResult Create(User user)
  {
      UserDL newUser = new UserDL();
      newUser.SignUp(user);
  
      return Json(new { success = true });
  
  }
  </code></pre>
  
  <p>and also I want to know is there any way to combine these values directly with my server side object</p>
  
  <p>User.cs</p>
  
  <pre><code>public class User
  {
      public virtual int ID { get; set; }
      public virtual string UserName { get; set; }
      public virtual string Password { get; set; }
      public virtual string EmailID { get; set; }
      public virtual int Phone { get; set; }
      public virtual string City { get; set; }
      public virtual string State { get; set; }
      public virtual int Zip { get; set; }
  
  }
  </code></pre>