title: How to save Data In Database to the controller
body: <p>How to save Data In Database to the controller.i am using jquery to get data from the textbox. please help me.</p>
  
  <p>Contactcontroller.cs</p>
  
  <pre><code>public ActionResult Create(string Name, string Company, string
   Regarding, string Email, string Phone, string Message)         {
             string body = "Name: " + Name + "&lt;br&gt;" + "\nCompany: " + Company + "&lt;br&gt;" + "Regarding: " + Regarding + "&lt;br&gt;" + "Email: " +
        Email + "&lt;br&gt;" + "Phone: " + Phone + "&lt;br&gt;" + "Message: " + Message;
                    try
       { 
     // code 
      } 
       catch
       {
  }
  </code></pre>
  
  <p>jquery.js</p>
  
  <pre><code>$("#btnSubmit").click(function (event) {
   var data = { Name: $("#txtbxName").val(), Company: $("#txtbxCompany").val(), Regarding:
              $("#ddlRegarding").val(), Email: $("#txtbxEmail").val(), Phone: $("#txtbxPhone").val(), Message:
              $("#txtarMessage").val()
          }
          $.ajax({
              type: "POST",
              url: "/Contact/Create",  // the method we are calling
              contentType: "application/json; charset=utf-8",
              data: JSON.stringify(data),
  
              dataType: "html",
              success: function (result) {
  
                  $("#txtarMessage").val("");
                  alert(result);
                  // Or if you are returning something
                  alert('I returned... ' + result.WhateverIsReturning);
              },
              error: function (result) {
  
                  alert('Thanks for sending info');
                  location.reload();
  
                  return false;
  
              }
          });
      });
  </code></pre>
  
  <p>i am getting data to the textbox using jquery.
  now i want to save the whole data in the database through Controller.</p>