title: How to pass data to Index view from another action result
body: <p>Here I am planning to display userIdCount in Index.cshtml. But this count i will get in different action result called GetUser. But when invokes getuser action it will call partial view and bind the results to index page. But I also want to display count of user id's on index view . I tried using TempData but its not working</p>
  
  <pre><code>public ActionResult GetUser(string UserName, int? Locality, string ReportType)
  {
      UserManager usersManager = new UserManager();
      List&lt;ReportsInfo&gt; reportsList = usersManager.GetRequestReport(UserName, Locality, "usp_GetUsers");
      TempData["UserIdCount"] = reportsList.Select(x =&gt; x.UserId).Distinct().Count();
      return PartialView("_ReportList", reportsList);
  }
  </code></pre>
  
  <p>In Index view I have used something like this below.</p>
  
  <pre><code> &lt;br /&gt;&lt;br /&gt;
              @if (TempData["UserIdCount"] != null)
              {
                  var test = TempData["UserIdCount"];
                  &lt;p&gt;@test&lt;/p&gt;
              }
  </code></pre>