title: return value along with partial view ajax call in mvc
body: <p>I am working on mvc4 project.I am using Dexexpress grid. What i want to do is when i click on add .. i do ajax call to check if user is in database..if not its saved into database and .. and i am returning paritial view of grid to refresh grid with latest data.</p>
  
  <p>But i want to return some value too along with gridview partial.. so that i can show whther that user is already added or not.</p>
  
  <p>Eg : Jquery code for ajax call</p>
  
  <pre><code>function AddUser() {
      showProgress();
      $.ajax({
          url: 'ManageUsers/AddUsers/?id=' + Math.random(),
          data: $("#frmManageUsers").serialize(),
          type: 'Post',
          datatype: 'json',
          success: function (data) {
              if (data != '') {                
                  $("#grid").html('');
                  $("#grid").html(data);
              }
              else
                  alert('No Record Found');
          },
          error: function (request, status, error) { ShowErrorMessage(); },
          complete: function () { hideProgress(); ShowSuccessMessage(); }
      });
  }  
  </code></pre>
  
  <p>and controller</p>
  
  <pre><code>public ActionResult AddUsers(Usertable model)
          {
              int successid = ManageUserExecutor.Save(model);
              if (successid == -1)
              {
                  List&lt;usp_GetListOfUsers_Result&gt; objList = new List&lt;usp_GetListOfUsers_Result&gt;();
                  return PartialView("GridViewPartial", objList);
              }
              else
                  return RedirectToAction("GridViewPartial");
          }
  </code></pre>
  
  <p>What i want is if i can get value of successid in ajax retrun along with gridview partial html ... so that i can display message according to that..</p>